Undo 3743. Really any time we create new instructions from whole cloth
during rewriting or transform, the whole notion of 'original name' goes
out the window. Pointless trying to fight that fact of life.
This commit is contained in:
Kartik K. Agaram 2017-02-07 00:07:16 -08:00
parent d9e39b3b1c
commit 3c4c9c0807
5 changed files with 4 additions and 9 deletions

View File

@ -41,7 +41,6 @@ struct instruction {
instruction();
void clear();
bool is_empty();
// End instruction Methods
};
:(before "struct instruction")

View File

@ -266,10 +266,6 @@ string old_name;
old_name.clear();
:(before "End next_instruction(curr)")
curr->old_name = curr->name; // before rewrite rules modify it
:(before "End instruction Methods")
void initialize_name(const string& n) {
name = old_name = n;
}
:(code)
// is this reagent one of the values returned by the current (return) instruction?

View File

@ -481,7 +481,7 @@ void fill_in_return_ingredients(const recipe_ordinal r) {
const instruction& final_instruction = caller_recipe.steps.at(SIZE(caller_recipe.steps)-1);
if (final_instruction.name != "reply" && final_instruction.name != "return") {
instruction inst;
inst.initialize_name("return");
inst.name = "return";
add_header_products(inst, caller_recipe);
caller_recipe.steps.push_back(inst);
}

View File

@ -46,7 +46,7 @@ void rewrite_literal_string_to_text(const recipe_ordinal r) {
instruction def;
ostringstream ingredient_name;
ingredient_name << inst.name << '_' << i << '_' << j << ":text";
def.initialize_name("new");
def.name = "new";
def.ingredients.push_back(inst.ingredients.at(j));
def.products.push_back(reagent(ingredient_name.str()));
new_instructions.push_back(def);

View File

@ -115,13 +115,13 @@ void convert_ingredient_to_text(reagent& r, vector<instruction>& out, const stri
if (is_static_array(r)) return;
instruction def;
if (is_lookup_of_address_of_array(r)) {
def.initialize_name("array-to-text-line");
def.name = "array-to-text-line";
reagent/*copy*/ tmp = r;
drop_one_lookup(tmp);
def.ingredients.push_back(tmp);
}
else {
def.initialize_name("to-text-line");
def.name = "to-text-line";
def.ingredients.push_back(r);
}
def.products.push_back(reagent(tmp_var));