feat(library/compiler/cse): ignore 0-ary macros during common subexpression elimination

This commit is contained in:
Leonardo de Moura 2016-12-12 07:40:46 -08:00
parent a972c13ce9
commit abfea1f388

View file

@ -74,7 +74,7 @@ class cse_fn : public compiler_step_visitor {
virtual void visit_macro(expr const & e) override {
if (check_visited(e)) return;
add_candidate(e);
if (macro_num_args(e) > 0) add_candidate(e);
for (unsigned i = 0; i < macro_num_args(e); i++)
visit(macro_arg(e, i));
}