about summary refs log tree commit diff stats
path: root/059generic_recipe.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-08 14:46:48 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-08 14:46:48 -0800
commitb954ac3812f15482db28db83a39ab7f6e56a4b06 (patch)
tree3b18b6a52897f0b52f254f379812980ebee92636 /059generic_recipe.cc
parent785a60fae9e2c55951f6c2053640c4d1da1174cf (diff)
downloadmu-b954ac3812f15482db28db83a39ab7f6e56a4b06.tar.gz
2399 - consistent debug_string vocabulary
Diffstat (limited to '059generic_recipe.cc')
-rw-r--r--059generic_recipe.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/059generic_recipe.cc b/059generic_recipe.cc
index 811869b6..afdc960f 100644
--- a/059generic_recipe.cc
+++ b/059generic_recipe.cc
@@ -170,8 +170,10 @@ void compute_type_names(recipe& variant) {
 }
 
 void save_or_deduce_type_name(reagent& x, map<string, string_tree*>& type_name) {
+  trace(9994, "transform") << "    checking " << x.to_string() << ": " << debug_string(x.properties.at(0).second) << end();
   if (!x.properties.at(0).second && contains_key(type_name, x.name)) {
     x.properties.at(0).second = new string_tree(*get(type_name, x.name));
+    trace(9994, "transform") << "    deducing type to " << debug_string(x.properties.at(0).second) << end();
     return;
   }
   if (!x.properties.at(0).second) {
@@ -181,9 +183,7 @@ void save_or_deduce_type_name(reagent& x, map<string, string_tree*>& type_name)
   if (contains_key(type_name, x.name)) return;
   if (x.properties.at(0).second->value == "offset" || x.properties.at(0).second->value == "variant") return;  // special-case for container-access instructions
   put(type_name, x.name, x.properties.at(0).second);
-  ostringstream type_name_buf;
-  dump_property(x.properties.at(0).second, type_name_buf);
-  trace(9993, "transform") << "type of " << x.name << " is " << type_name_buf.str() << end();
+  trace(9993, "transform") << "type of " << x.name << " is " << debug_string(x.properties.at(0).second) << end();
 }
 
 void compute_type_ingredient_mappings(const recipe& exemplar, const instruction& inst, map<string, const string_tree*>& mappings) {
@@ -221,9 +221,7 @@ void accumulate_type_ingredients(const string_tree* base, const string_tree* ref
       return;
     }
     if (!contains_key(mappings, base->value)) {
-      ostringstream tmp;
-      dump_property(refinement, tmp);
-      trace(9993, "transform") << "adding mapping from " << base->value << " to " << tmp.str() << end();
+      trace(9993, "transform") << "adding mapping from " << base->value << " to " << debug_string(refinement) << end();
       put(mappings, base->value, new string_tree(*refinement));
     }
     else {
@@ -298,22 +296,18 @@ void replace_type_ingredients(reagent& x, const map<string, const string_tree*>&
   delete x.type;
   x.type = new_type_tree(x.properties.at(0).second);
   if (x.type)
-    trace(9993, "transform") << "  after: " << dump_types(x) << end();
+    trace(9993, "transform") << "  after: " << debug_string(x.type) << end();
 }
 
 void replace_type_ingredients(string_tree* type, const map<string, const string_tree*>& mappings) {
   if (!type) return;
   if (is_type_ingredient_name(type->value) && contains_key(mappings, type->value)) {
     const string_tree* replacement = get(mappings, type->value);
-    ostringstream tmp;
-    dump_property(replacement, tmp);
-    trace(9993, "transform") << type->value << " => " << tmp.str() << end();
+    trace(9993, "transform") << type->value << " => " << debug_string(replacement) << end();
     type->value = replacement->value;
     if (replacement->left) type->left = new string_tree(*replacement->left);
     if (replacement->right) type->right = new string_tree(*replacement->right);
-    ostringstream tmp2;
-    dump_property(type, tmp2);
-    trace(9993, "transform") << " ===> " << tmp2.str() << end();
+    trace(9993, "transform") << " ===> " << debug_string(type) << end();
   }
   replace_type_ingredients(type->left, mappings);
   replace_type_ingredients(type->right, mappings);