diff options
| author | gingerBill <bill@gingerbill.org> | 2021-11-14 15:22:40 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-11-14 15:22:40 +0000 |
| commit | f47311f2f6c59856efd64c56101cc004d1b15bc2 (patch) | |
| tree | 11fb70eb39f725c82f8e013ac2a922b22cb63355 /src/llvm_backend_stmt.cpp | |
| parent | 3f038428a7f282468011415db76da4bf08ddb67c (diff) | |
Remove `scope` field from `Ast`
Diffstat (limited to 'src/llvm_backend_stmt.cpp')
| -rw-r--r-- | src/llvm_backend_stmt.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index ec8ded7fa..c2ff0dfe1 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -1625,7 +1625,7 @@ void lb_build_return_stmt(lbProcedure *p, Slice<Ast *> const &return_results) { void lb_build_if_stmt(lbProcedure *p, Ast *node) { ast_node(is, IfStmt, node); - lb_open_scope(p, node->scope); // Scope #1 + lb_open_scope(p, is->scope); // Scope #1 defer (lb_close_scope(p, lbDeferExit_Default, nullptr)); if (is->init != nullptr) { @@ -1675,7 +1675,7 @@ void lb_build_if_stmt(lbProcedure *p, Ast *node) { lb_emit_jump(p, else_); lb_start_block(p, else_); - lb_open_scope(p, is->else_stmt->scope); + lb_open_scope(p, scope_of_node(is->else_stmt)); lb_build_stmt(p, is->else_stmt); lb_close_scope(p, lbDeferExit_Default, nullptr); } @@ -1692,7 +1692,7 @@ void lb_build_if_stmt(lbProcedure *p, Ast *node) { if (is->else_stmt != nullptr) { lb_start_block(p, else_); - lb_open_scope(p, is->else_stmt->scope); + lb_open_scope(p, scope_of_node(is->else_stmt)); lb_build_stmt(p, is->else_stmt); lb_close_scope(p, lbDeferExit_Default, nullptr); @@ -1710,7 +1710,7 @@ void lb_build_if_stmt(lbProcedure *p, Ast *node) { void lb_build_for_stmt(lbProcedure *p, Ast *node) { ast_node(fs, ForStmt, node); - lb_open_scope(p, node->scope); // Open Scope here + lb_open_scope(p, fs->scope); // Open Scope here if (fs->init != nullptr) { #if 1 @@ -2056,7 +2056,7 @@ void lb_build_stmt(lbProcedure *p, Ast *node) { tl->is_block = true; } - lb_open_scope(p, node->scope); + lb_open_scope(p, bs->scope); lb_build_stmt_list(p, bs->stmts); lb_close_scope(p, lbDeferExit_Default, nullptr); @@ -2137,15 +2137,15 @@ void lb_build_stmt(lbProcedure *p, Ast *node) { case_end; case_ast_node(rs, RangeStmt, node); - lb_build_range_stmt(p, rs, node->scope); + lb_build_range_stmt(p, rs, rs->scope); case_end; case_ast_node(rs, UnrollRangeStmt, node); - lb_build_unroll_range_stmt(p, rs, node->scope); + lb_build_unroll_range_stmt(p, rs, rs->scope); case_end; case_ast_node(ss, SwitchStmt, node); - lb_build_switch_stmt(p, ss, node->scope); + lb_build_switch_stmt(p, ss, ss->scope); case_end; case_ast_node(ss, TypeSwitchStmt, node); |