Commit d298bd3e authored by Yang's avatar Yang

fix lab2 bug

parent 52615882
...@@ -156,6 +156,7 @@ void Function::check_for_block_relation_error() ...@@ -156,6 +156,7 @@ void Function::check_for_block_relation_error()
} }
} }
// 检查基本块的前驱和后继表不包含重复的基本块 // 检查基本块的前驱和后继表不包含重复的基本块
/*
for (auto& bb : basic_blocks_) for (auto& bb : basic_blocks_)
{ {
bbs.clear(); bbs.clear();
...@@ -168,6 +169,7 @@ void Function::check_for_block_relation_error() ...@@ -168,6 +169,7 @@ void Function::check_for_block_relation_error()
bbs.emplace(suc); bbs.emplace(suc);
} }
} }
*/
// 检查基本块基本信息 // 检查基本块基本信息
for (auto& bb : basic_blocks_) for (auto& bb : basic_blocks_)
{ {
...@@ -197,7 +199,7 @@ void Function::check_for_block_relation_error() ...@@ -197,7 +199,7 @@ void Function::check_for_block_relation_error()
for(auto i : suc_table) { for(auto i : suc_table) {
bool ok = false; bool ok = false;
for(auto j : i->get_pre_basic_blocks()) { for(auto j : i->get_pre_basic_blocks()) {
if(j == i){ if(j == &bb){
ok = true; ok = true;
break; break;
} }
......
...@@ -76,7 +76,7 @@ lv1 = { ...@@ -76,7 +76,7 @@ lv1 = {
"transfer_int_to_float": (1, False), "transfer_int_to_float": (1, False),
} }
# 23 # 24
lv2 = { lv2 = {
"funcall_chain": (2, False), "funcall_chain": (2, False),
"assign_chain": (2, False), "assign_chain": (2, False),
...@@ -86,16 +86,17 @@ lv2 = { ...@@ -86,16 +86,17 @@ lv2 = {
"funcall_array_array": (2, False), "funcall_array_array": (2, False),
"return_in_middle1": (2, False), "return_in_middle1": (2, False),
"return_in_middle2": (2, False), "return_in_middle2": (2, False),
"funcall_type_mismatch1": (2, False), "funcall_type_mismatch1": (1.5, False),
"funcall_type_mismatch2": (2, False), "funcall_type_mismatch2": (1.5, False),
"return_type_mismatch1": (1.5, False), "return_type_mismatch1": (1.5, False),
"return_type_mismatch2": (1.5, False), "return_type_mismatch2": (1.5, False),
"alloca_in_loop": (2, False)
} }
# 11 # 10
lv3 = { lv3 = {
"complex1": (3, False), "complex1": (2.5, False),
"complex2": (3, True), "complex2": (2.5, True),
"complex3": (2, True), "complex3": (2, True),
"complex4": (3, False), "complex4": (3, False),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment