about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-07 13:54:49 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-07 13:54:49 -0800
commitcb0060ee0f88149968a8f2b0bbf617c88ea46753 (patch)
treee40cdd6265c0661eae743b2cc877bd287fe07162
parentd71d3b4aaa995681a20207d72cf3b6ac9c3d72c0 (diff)
downloadmu-cb0060ee0f88149968a8f2b0bbf617c88ea46753.tar.gz
2389
Now we're back to trying to rerunning idempotent transforms on
specialized recipes. Still doesn't work, but at least we don't see
different results depending on whether the trace is enabled inside the
test or right at the start. That got fixed by the more disciplined
insertion into maps, looks like.
-rw-r--r--003trace.cc2
-rw-r--r--020run.cc4
-rw-r--r--059generic_recipe.cc6
3 files changed, 9 insertions, 3 deletions
diff --git a/003trace.cc b/003trace.cc
index 4a563fc6..fa333191 100644
--- a/003trace.cc
+++ b/003trace.cc
@@ -198,7 +198,7 @@ struct lease_tracer {
 
 #define START_TRACING_UNTIL_END_OF_SCOPE  lease_tracer leased_tracer;
 :(before "End Test Setup")
-START_TRACING_UNTIL_END_OF_SCOPE
+//? START_TRACING_UNTIL_END_OF_SCOPE
 
 :(before "End Includes")
 #define CHECK_TRACE_CONTENTS(...)  check_trace_contents(__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
diff --git a/020run.cc b/020run.cc
index fad6a5b0..1a822be1 100644
--- a/020run.cc
+++ b/020run.cc
@@ -134,8 +134,8 @@ inline bool routine::completed() const {
 
 //: Step 1: load all .mu files with numeric prefixes (in order)
 :(before "End Load Recipes")
-//? Trace_file = "interactive";
-//? START_TRACING_UNTIL_END_OF_SCOPE;
+Trace_file = "interactive";
+START_TRACING_UNTIL_END_OF_SCOPE;
 load_permanently("core.mu");
 transform_all();
 
diff --git a/059generic_recipe.cc b/059generic_recipe.cc
index 64dbf6a1..e31a5d12 100644
--- a/059generic_recipe.cc
+++ b/059generic_recipe.cc
@@ -153,6 +153,12 @@ recipe_ordinal new_variant(recipe_ordinal exemplar, const instruction& inst) {
   map<string, string> mappings;  // weak references
   compute_type_ingredient_mappings(get(Recipe, exemplar), inst, mappings);
   replace_type_ingredients(new_recipe, mappings);
+  // redo all previous transforms in the new specialization, except for non-idempotent ones
+  // including this one in case there are new ambiguous calls in the specialization
+  for (long long int t = 0; t <= new_recipe.transformed_until; ++t) {
+    if (Transform.at(t) == insert_fragments) continue;  // not idempotent
+    (*Transform.at(t))(result);
+  }
   return result;
 }