about summary refs log tree commit diff stats
path: root/html/087file.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-23 23:03:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-23 23:03:56 -0700
commit54edd3d25e990cdf6ead2f0cdf685bc23de85edf (patch)
tree5479bfaf361a485570b2ebbe22064fefe9b55a89 /html/087file.cc.html
parentb2eff9f97e02fe6f5f55133002c16116aac13ed4 (diff)
downloadmu-54edd3d25e990cdf6ead2f0cdf685bc23de85edf.tar.gz
3943
Undo commit 3938 and almost everything after. Let's do this right.
Diffstat (limited to 'html/087file.cc.html')
0 files changed, 0 insertions, 0 deletions
013update_operation.cc?h=hlt&id=b24eb4766ad12eceaafa2ee0d620e070e21a3293'>b24eb476 ^
82177734 ^
e6692482 ^
f3760b0f ^
9dcbec39 ^
83266c76 ^
e6692482 ^
795f5244 ^
82177734 ^
e6692482 ^


a0b9fa55 ^
e6692482 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


                                                                              
                                                
                                                                  


                                                      
                                                                                                               

                                                                                      
                                                            
                                               
                                
                                                   
                                                                                                  
               
     
                                                    
                                       


   
                                                                        


                        
//: Once all code is loaded, save operation ids of instructions and check that
//: nothing's undefined.

:(before "End Instruction Modifying Transforms")
Transform.push_back(update_instruction_operations);  // idempotent

:(code)
void update_instruction_operations(recipe_ordinal r) {
  trace(9991, "transform") << "--- compute instruction operations for recipe " << get(Recipe, r).name << end();
  recipe& caller = get(Recipe, r);
//?   cerr << "--- compute instruction operations for recipe " << caller.name << '\n';
  for (int index = 0; index < SIZE(caller.steps); ++index) {
    instruction& inst = caller.steps.at(index);
    if (inst.is_label) continue;
    if (!contains_key(Recipe_ordinal, inst.name)) {
      raise << maybe(caller.name) << "instruction '" << inst.name << "' has no recipe\n" << end();
      continue;
    }
    inst.operation = get(Recipe_ordinal, inst.name);
    // End Instruction Operation Checks
  }
}

// hook to suppress inserting recipe name into errors (for later layers)
string maybe(string s) {
  return s + ": ";
}