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-07 13:54:49 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-07 13:54:49 -0800
commitcb0060ee0f88149968a8f2b0bbf617c88ea46753 (patch)
treee40cdd6265c0661eae743b2cc877bd287fe07162 /059generic_recipe.cc
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.
Diffstat (limited to '059generic_recipe.cc')
-rw-r--r--059generic_recipe.cc6
1 files changed, 6 insertions, 0 deletions
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;
 }