for(Stage &s: module->stages)
ConstantSpecializer().apply(s, spec_values);
}
+ if(mode==PROGRAM)
+ {
+ for(Stage &s: module->stages)
+ DepthRangeConverter().apply(s, features);
+ }
for(auto i=module->stages.begin(); i!=module->stages.end(); )
{
OptimizeResult result = optimize(*i);
++i;
}
+ Stage *prev_stage = 0;
+ for(auto i=module->stages.begin(); i!=module->stages.end(); )
+ {
+ if(i->functions.empty())
+ i = module->stages.erase(i);
+ else
+ {
+ i->previous = prev_stage;
+ prev_stage = &*i;
+ ++i;
+ }
+ }
+
for(Stage &s: module->stages)
{
StructuralFeatureConverter().apply(s, features);
return module->source_map;
}
-string Compiler::get_stage_debug(Stage::Type stage_type) const
+string Compiler::get_stage_debug(Stage::Type stage_type, bool use_colors) const
{
auto i = find_member(module->stages, stage_type, &Stage::type);
if(i!=module->stages.end())
- return DumpTree().apply(*i);
+ return DumpTree(use_colors).apply(*i);
throw key_error(Stage::get_stage_name(stage_type));
}
variables through interfaces. */
InterfaceGenerator().apply(stage);
resolve(stage, RESOLVE_BLOCKS|RESOLVE_TYPES|RESOLVE_VARIABLES);
+
+ ArraySizer().apply(stage);
+ resolve(stage, RESOLVE_EXPRESSIONS);
}
template<typename T>