Fixed mem2reg warning message
authorClifford Wolf <clifford@clifford.at>
Sat, 27 Dec 2014 02:26:30 +0000 (03:26 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 27 Dec 2014 02:26:30 +0000 (03:26 +0100)
frontends/ast/simplify.cc

index a78fafbd13a9f55cda8b12b69d75e430d02ba1f9..b7670194310cf25ed24137431fbb78cb4b80d391 100644 (file)
@@ -102,13 +102,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 
                        verbose_activate:
                                if (mem2reg_set.count(mem) == 0) {
-                                       log_warning("Replacing memory %s with list of registers.", mem->str.c_str());
+                                       std::string message = stringf("Replacing memory %s with list of registers.", mem->str.c_str());
                                        bool first_element = true;
                                        for (auto &place : mem2reg_places[it.first]) {
-                                               log("%s%s", first_element ? " See " : ", ", place.c_str());
+                                               message += stringf("%s%s", first_element ? " See " : ", ", place.c_str());
                                                first_element = false;
                                        }
-                                       log("\n");
+                                       log_warning("%s\n", message.c_str());
                                }
 
                        silent_activate: