From cb7b403210f13e721739d58dab9000ec51ed2d0a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 25 Feb 2019 00:26:48 -0800 Subject: 4989 --- html/subx/036global_variables.cc.html | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'html/subx/036global_variables.cc.html') diff --git a/html/subx/036global_variables.cc.html b/html/subx/036global_variables.cc.html index 05e31e17..eac4c776 100644 --- a/html/subx/036global_variables.cc.html +++ b/html/subx/036global_variables.cc.html @@ -78,14 +78,14 @@ if ('onhashchange' in window) { 15 +transform: global variable 'x' is at address 0x0a000079 16 17 :(before "End Level-2 Transforms") - 18 Transform.push_back(rewrite_global_variables); + 18 Transform.push_back(rewrite_global_variables); 19 :(code) 20 void rewrite_global_variables(program& p) { - 21 trace(99, "transform") << "-- rewrite global variables" << end(); + 21 trace(3, "transform") << "-- rewrite global variables" << end(); 22 // Begin rewrite_global_variables 23 map<string, uint32_t> address; 24 compute_addresses_for_global_variables(p, address); - 25 if (trace_contains_errors()) return; + 25 if (trace_contains_errors()) return; 26 drop_global_variables(p); 27 replace_global_variables_with_addresses(p, address); 28 } @@ -108,17 +108,17 @@ if ('onhashchange' in window) { 45 string variable = drop_last(curr.data); 46 // ensure variables look sufficiently different from raw hex 47 check_valid_name(variable); - 48 if (trace_contains_errors()) return; + 48 if (trace_contains_errors()) return; 49 if (j > 0) - 50 raise << "'" << to_string(inst) << "': global variable names can only be the first word in a line.\n" << end(); + 50 raise << "'" << to_string(inst) << "': global variable names can only be the first word in a line.\n" << end(); 51 if (Map_file.is_open()) - 52 Map_file << "0x" << HEXWORD << current_address << ' ' << variable << '\n'; + 52 Map_file << "0x" << HEXWORD << current_address << ' ' << variable << '\n'; 53 if (contains_key(address, variable)) { - 54 raise << "duplicate global '" << variable << "'\n" << end(); + 54 raise << "duplicate global '" << variable << "'\n" << end(); 55 return; 56 } 57 put(address, variable, current_address); - 58 trace(99, "transform") << "global variable '" << variable << "' is at address 0x" << HEXWORD << current_address << end(); + 58 trace(99, "transform") << "global variable '" << variable << "' is at address 0x" << HEXWORD << current_address << end(); 59 // no modifying current_address; global variable definitions won't be in the final binary 60 } 61 } @@ -145,18 +145,18 @@ if ('onhashchange' in window) { 82 const word& curr = inst.words.at(j); 83 if (!contains_key(address, curr.data)) { 84 if (!looks_like_hex_int(curr.data)) - 85 raise << "missing reference to global '" << curr.data << "'\n" << end(); + 85 raise << "missing reference to global '" << curr.data << "'\n" << end(); 86 new_inst.words.push_back(curr); 87 continue; 88 } 89 if (!valid_use_of_global_variable(curr)) { - 90 raise << "'" << to_string(inst) << "': can't refer to global variable '" << curr.data << "'\n" << end(); + 90 raise << "'" << to_string(inst) << "': can't refer to global variable '" << curr.data << "'\n" << end(); 91 return; 92 } 93 emit_hex_bytes(new_inst, get(address, curr.data), 4); 94 } 95 inst.words.swap(new_inst.words); - 96 trace(99, "transform") << "instruction after transform: '" << data_to_string(inst) << "'" << end(); + 96 trace(99, "transform") << "instruction after transform: '" << data_to_string(inst) << "'" << end(); 97 } 98 } 99 @@ -175,25 +175,25 @@ if ('onhashchange' in window) { 112 else if (has_operand_metadata(curr, "imm8")) 113 emit_hex_bytes(new_l, curr, 1); 114 else if (has_operand_metadata(curr, "disp8")) -115 raise << "can't use /disp8 in a non-code segment\n" << end(); +115 raise << "can't use /disp8 in a non-code segment\n" << end(); 116 else if (has_operand_metadata(curr, "disp16")) -117 raise << "can't use /disp16 in a non-code segment\n" << end(); +117 raise << "can't use /disp16 in a non-code segment\n" << end(); 118 else if (has_operand_metadata(curr, "disp32")) -119 raise << "can't use /disp32 in a non-code segment\n" << end(); +119 raise << "can't use /disp32 in a non-code segment\n" << end(); 120 else 121 new_l.words.push_back(curr); 122 } 123 else { -124 raise << "missing reference to global '" << curr.data << "'\n" << end(); +124 raise << "missing reference to global '" << curr.data << "'\n" << end(); 125 new_l.words.push_back(curr); 126 } 127 continue; 128 } -129 trace(99, "transform") << curr.data << " maps to " << HEXWORD << get(address, curr.data) << end(); +129 trace(99, "transform") << curr.data << " maps to " << HEXWORD << get(address, curr.data) << end(); 130 emit_hex_bytes(new_l, get(address, curr.data), 4); 131 } 132 l.words.swap(new_l.words); -133 trace(99, "transform") << "after transform: '" << data_to_string(l) << "'" << end(); +133 trace(99, "transform") << "after transform: '" << data_to_string(l) << "'" << end(); 134 } 135 } 136 @@ -207,7 +207,7 @@ if ('onhashchange' in window) { 144 //: requires first saving some data early before we pack operands 145 146 :(after "Begin Level-2 Transforms") -147 Transform.push_back(correlate_disp32_with_mod); +147 Transform.push_back(correlate_disp32_with_mod); 148 :(code) 149 void correlate_disp32_with_mod(program& p) { 150 if (p.segments.empty()) return; -- cgit 1.4.1-2-gfad0