From 695f9bf8d0a7d0a871b8ab75270ceb29715d9be3 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 25 Jul 2019 00:08:23 -0700 Subject: 5468 --- html/subx/036global_variables.cc.html | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 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 ba0ae24d..427657c8 100644 --- a/html/subx/036global_variables.cc.html +++ b/html/subx/036global_variables.cc.html @@ -76,7 +76,7 @@ if ('onhashchange' in window) { 15 "x:\n" 16 " 00 00 00 00\n" 17 ); - 18 CHECK_TRACE_CONTENTS( + 18 CHECK_TRACE_CONTENTS( 19 "transform: global variable 'x' is at address 0x00002000\n" 20 ); 21 } @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 28 // Begin rewrite_global_variables 29 map<string, uint32_t> address; 30 compute_addresses_for_global_variables(p, address); - 31 if (trace_contains_errors()) return; + 31 if (trace_contains_errors()) return; 32 drop_global_variables(p); 33 replace_global_variables_with_addresses(p, address); 34 } @@ -114,17 +114,17 @@ if ('onhashchange' in window) { 53 string variable = drop_last(curr.data); 54 // ensure variables look sufficiently different from raw hex 55 check_valid_name(variable); - 56 if (trace_contains_errors()) return; + 56 if (trace_contains_errors()) return; 57 if (j > 0) - 58 raise << "'" << to_string(inst) << "': global variable names can only be the first word in a line.\n" << end(); + 58 raise << "'" << to_string(inst) << "': global variable names can only be the first word in a line.\n" << end(); 59 if (Labels_file.is_open()) - 60 Labels_file << "0x" << HEXWORD << current_address << ' ' << variable << '\n'; + 60 Labels_file << "0x" << HEXWORD << current_address << ' ' << variable << '\n'; 61 if (contains_key(address, variable)) { - 62 raise << "duplicate global '" << variable << "'\n" << end(); + 62 raise << "duplicate global '" << variable << "'\n" << end(); 63 return; 64 } 65 put(address, variable, current_address); - 66 trace(99, "transform") << "global variable '" << variable << "' is at address 0x" << HEXWORD << current_address << end(); + 66 trace(99, "transform") << "global variable '" << variable << "' is at address 0x" << HEXWORD << current_address << end(); 67 // no modifying current_address; global variable definitions won't be in the final binary 68 } 69 } @@ -157,12 +157,12 @@ if ('onhashchange' in window) { 96 const word& curr = inst.words.at(j); 97 if (!contains_key(address, curr.data)) { 98 if (!looks_like_hex_int(curr.data)) - 99 raise << "missing reference to global '" << curr.data << "'\n" << end(); + 99 raise << "missing reference to global '" << curr.data << "'\n" << end(); 100 new_inst.words.push_back(curr); 101 continue; 102 } 103 if (!valid_use_of_global_variable(curr)) { -104 raise << "'" << to_string(inst) << "': can't refer to global variable '" << curr.data << "'\n" << end(); +104 raise << "'" << to_string(inst) << "': can't refer to global variable '" << curr.data << "'\n" << end(); 105 return; 106 } 107 emit_hex_bytes(new_inst, get(address, curr.data), 4); @@ -187,21 +187,21 @@ if ('onhashchange' in window) { 126 else if (has_operand_metadata(curr, "imm8")) 127 emit_hex_bytes(new_l, curr, 1); 128 else if (has_operand_metadata(curr, "disp8")) -129 raise << "can't use /disp8 in a non-code segment\n" << end(); +129 raise << "can't use /disp8 in a non-code segment\n" << end(); 130 else if (has_operand_metadata(curr, "disp16")) -131 raise << "can't use /disp16 in a non-code segment\n" << end(); +131 raise << "can't use /disp16 in a non-code segment\n" << end(); 132 else if (has_operand_metadata(curr, "disp32")) -133 raise << "can't use /disp32 in a non-code segment\n" << end(); +133 raise << "can't use /disp32 in a non-code segment\n" << end(); 134 else 135 new_l.words.push_back(curr); 136 } 137 else { -138 raise << "missing reference to global '" << curr.data << "'\n" << end(); +138 raise << "missing reference to global '" << curr.data << "'\n" << end(); 139 new_l.words.push_back(curr); 140 } 141 continue; 142 } -143 trace(99, "transform") << curr.data << " maps to " << HEXWORD << get(address, curr.data) << end(); +143 trace(99, "transform") << curr.data << " maps to " << HEXWORD << get(address, curr.data) << end(); 144 emit_hex_bytes(new_l, get(address, curr.data), 4); 145 } 146 l.words.swap(new_l.words); @@ -257,7 +257,7 @@ if ('onhashchange' in window) { 196 "x:\n" 197 " 00 00 00 00\n" 198 ); -199 CHECK_TRACE_CONTENTS( +199 CHECK_TRACE_CONTENTS( 200 "error: 'eb/jump x/disp8': can't refer to global variable 'x'\n" 201 // sub-optimal error message; should be 202 //? "error: can't jump to data (variable 'x')\n" @@ -273,7 +273,7 @@ if ('onhashchange' in window) { 212 "x:\n" 213 " 00 00 00 00\n" 214 ); -215 CHECK_TRACE_CONTENTS( +215 CHECK_TRACE_CONTENTS( 216 "error: 'e8/call x/disp32': can't refer to global variable 'x'\n" 217 // sub-optimal error message; should be 218 //? "error: can't call to the data segment ('x')\n" @@ -291,13 +291,13 @@ if ('onhashchange' in window) { 230 " 00 00 00 00\n" 231 ); 232 // check that we loaded 'x' with the address of 'y' -233 CHECK_TRACE_CONTENTS( +233 CHECK_TRACE_CONTENTS( 234 "load: 0x00002000 -> 04\n" 235 "load: 0x00002001 -> 20\n" 236 "load: 0x00002002 -> 00\n" 237 "load: 0x00002003 -> 00\n" 238 ); -239 CHECK_TRACE_COUNT("error", 0); +239 CHECK_TRACE_COUNT("error", 0); 240 } 241 242 void test_raw_number_with_imm32_in_data_segment() { @@ -309,13 +309,13 @@ if ('onhashchange' in window) { 248 " 1/imm32\n" 249 ); 250 // check that we loaded 'x' with the address of 1 -251 CHECK_TRACE_CONTENTS( +251 CHECK_TRACE_CONTENTS( 252 "load: 0x00002000 -> 01\n" 253 "load: 0x00002001 -> 00\n" 254 "load: 0x00002002 -> 00\n" 255 "load: 0x00002003 -> 00\n" 256 ); -257 CHECK_TRACE_COUNT("error", 0); +257 CHECK_TRACE_COUNT("error", 0); 258 } 259 260 void test_duplicate_global_variable() { @@ -328,7 +328,7 @@ if ('onhashchange' in window) { 267 "x:\n" 268 " 00\n" 269 ); -270 CHECK_TRACE_CONTENTS( +270 CHECK_TRACE_CONTENTS( 271 "error: duplicate global 'x'\n" 272 ); 273 } @@ -341,7 +341,7 @@ if ('onhashchange' in window) { 280 "x:\n" 281 " 00 00 00 00\n" 282 ); -283 CHECK_TRACE_COUNT("error", 0); +283 CHECK_TRACE_COUNT("error", 0); 284 } 285 286 void test_global_variable_disp32_with_call() { @@ -351,7 +351,7 @@ if ('onhashchange' in window) { 290 " e8/call bar/disp32\n" 291 "bar:\n" 292 ); -293 CHECK_TRACE_COUNT("error", 0); +293 CHECK_TRACE_COUNT("error", 0); 294 } 295 296 string to_full_string(const line& in) { -- cgit 1.4.1-2-gfad0