{
if(ConstantFolder().apply(stage))
resolve(stage, RESOLVE_EXPRESSIONS);
- ConstantConditionEliminator().apply(stage);
+ if(ConstantConditionEliminator().apply(stage))
+ resolve(stage, RESOLVE_VARIABLES);
bool any_inlined = false;
if(FunctionInliner().apply(stage))
}
-void ConstantConditionEliminator::apply(Stage &stage)
+bool ConstantConditionEliminator::apply(Stage &stage)
{
stage.content.visit(*this);
NodeRemover().apply(stage, nodes_to_remove);
+ return !nodes_to_remove.empty();
}
ConstantConditionEliminator::ConstantStatus ConstantConditionEliminator::check_constant_condition(const Expression &expr)
bool r_external_side_effects = false;
public:
- void apply(Stage &);
+ bool apply(Stage &);
private:
ConstantStatus check_constant_condition(const Expression &);