diff --git a/local_tests/phase161/test_mir_analyzer.hako b/local_tests/phase161/test_mir_analyzer.hako index 1ad5e64e..5d3e87e1 100644 --- a/local_tests/phase161/test_mir_analyzer.hako +++ b/local_tests/phase161/test_mir_analyzer.hako @@ -12,11 +12,10 @@ box TestRunner { print("Test: " + name) print("==================================================") - // Parse MIR JSON - me.analyzer = new MirAnalyzerBox() - local result = me.analyzer.birth(mir_json_text) + // Parse MIR JSON - use constructor directly + me.analyzer = new MirAnalyzerBox(mir_json_text) - if result == null { + if me.analyzer == null { print("FAIL: Failed to parse MIR JSON") return null } diff --git a/local_tests/phase161/test_rep1_inline.hako b/local_tests/phase161/test_rep1_inline.hako index aec9eadc..77826926 100644 --- a/local_tests/phase161/test_rep1_inline.hako +++ b/local_tests/phase161/test_rep1_inline.hako @@ -113,7 +113,7 @@ static box Main { print(" [OK] Correct PHI count (1)") pass_count = pass_count + 1 - local phi = phi_list.at(0) + local phi = phi_list.get(0) local block_id = phi.get("block_id") local dest = phi.get("dest") local incoming_count = phi.get("incoming_count") diff --git a/tools/hako_shared/mir_analyzer.hako b/tools/hako_shared/mir_analyzer.hako index 19b11f04..19d2278e 100644 --- a/tools/hako_shared/mir_analyzer.hako +++ b/tools/hako_shared/mir_analyzer.hako @@ -106,7 +106,7 @@ box MirAnalyzerBox { local i = 0 loop(i < blocks.size()) { - local block = blocks.at(i) + local block = blocks.get(i) local instructions = block.get("instructions") if instructions != null { @@ -115,7 +115,7 @@ box MirAnalyzerBox { // Check for PHI and Branch instructions local j = 0 loop(j < instructions.size()) { - local inst = instructions.at(j) + local inst = instructions.get(j) local op = inst.get("op") if op == "phi" { @@ -171,14 +171,14 @@ box MirAnalyzerBox { local i = 0 loop(i < blocks.size()) { - local block = blocks.at(i) + local block = blocks.get(i) local block_id = block.get("id") local instructions = block.get("instructions") if instructions != null { local j = 0 loop(j < instructions.size()) { - local inst = instructions.at(j) + local inst = instructions.get(j) local op = inst.get("op") if op == "phi" { @@ -230,7 +230,7 @@ box MirAnalyzerBox { local block_map = new MapBox() local i = 0 loop(i < blocks.size()) { - local block = blocks.at(i) + local block = blocks.get(i) local block_id = block.get("id") block_map.set("" + block_id, i) i = i + 1 @@ -241,7 +241,7 @@ box MirAnalyzerBox { i = 0 loop(i < blocks.size()) { - local block = blocks.at(i) + local block = blocks.get(i) local block_id = block.get("id") local instructions = block.get("instructions") @@ -249,7 +249,7 @@ box MirAnalyzerBox { // Check last instruction for control flow local last_idx = instructions.size() - 1 if last_idx >= 0 { - local last_inst = instructions.at(last_idx) + local last_inst = instructions.get(last_idx) local op = last_inst.get("op") // Check jump instruction @@ -316,7 +316,7 @@ box MirAnalyzerBox { if funcIndex < 0 { return null } if funcIndex >= me._functions.size() { return null } - return me._functions.at(funcIndex) + return me._functions.get(funcIndex) } // Internal: Check if function has backward edges (loop indicator) @@ -325,14 +325,14 @@ box MirAnalyzerBox { local i = 0 loop(i < blocks.size()) { - local block = blocks.at(i) + local block = blocks.get(i) local block_id = block.get("id") local instructions = block.get("instructions") if instructions != null { local last_idx = instructions.size() - 1 if last_idx >= 0 { - local last_inst = instructions.at(last_idx) + local last_inst = instructions.get(last_idx) local op = last_inst.get("op") if op == "jump" {