diff --git a/src/lightir/Function.cpp b/src/lightir/Function.cpp index dfb79a43963470cb7e96a038e8ccdcbaa87f4f3b..e10fd7c2efa08a22abcd7082486ad76e0d11a58e 100644 --- a/src/lightir/Function.cpp +++ b/src/lightir/Function.cpp @@ -156,7 +156,8 @@ void Function::check_for_block_relation_error() } } // 检查基本块的前驱和后继表不包含重复的基本块 - for (auto& bb : basic_blocks_) + /* + for (auto& bb : basic_blocks_) { bbs.clear(); for(auto suc: bb.get_succ_basic_blocks()){ @@ -168,6 +169,7 @@ void Function::check_for_block_relation_error() bbs.emplace(suc); } } + */ // 检查基本块基本信息 for (auto& bb : basic_blocks_) { @@ -197,7 +199,7 @@ void Function::check_for_block_relation_error() for(auto i : suc_table) { bool ok = false; for(auto j : i->get_pre_basic_blocks()) { - if(j == i){ + if(j == &bb){ ok = true; break; } diff --git a/tests/2-ir-gen/autogen/eval_lab2.py b/tests/2-ir-gen/autogen/eval_lab2.py index e25399f0f2f0b601643fee0463247db7270cfb3e..0d4298551bd2a10f6b1a8f306a0e896f274cc9a5 100755 --- a/tests/2-ir-gen/autogen/eval_lab2.py +++ b/tests/2-ir-gen/autogen/eval_lab2.py @@ -76,7 +76,7 @@ lv1 = { "transfer_int_to_float": (1, False), } -# 23 +# 24 lv2 = { "funcall_chain": (2, False), "assign_chain": (2, False), @@ -86,16 +86,17 @@ lv2 = { "funcall_array_array": (2, False), "return_in_middle1": (2, False), "return_in_middle2": (2, False), - "funcall_type_mismatch1": (2, False), - "funcall_type_mismatch2": (2, False), + "funcall_type_mismatch1": (1.5, False), + "funcall_type_mismatch2": (1.5, False), "return_type_mismatch1": (1.5, False), "return_type_mismatch2": (1.5, False), + "alloca_in_loop": (2, False) } -# 11 +# 10 lv3 = { - "complex1": (3, False), - "complex2": (3, True), + "complex1": (2.5, False), + "complex2": (2.5, True), "complex3": (2, True), "complex4": (3, False), }