authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-02-06 19:45:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-02-06 19:45:49-07:00
log495fd4ee3e81bd9d26768cdb8fc639afac79d9dc
treeb4b3aad0abbdaabd99648b52bc6a097d20b140b7
parent287ff4ab58f8af70383b6e334c7c862c8b8fbeec

AstGen: refactor redundant expressions

This is a non-functional change.

1 files changed, 3 insertions(+), 3 deletions(-)

src/AstGen.zig+3-3
...@@ -2601,8 +2601,8 @@ fn varDecl(...@@ -2601,8 +2601,8 @@ fn varDecl(
26012601
2602 var resolve_inferred_alloc: Zir.Inst.Ref = .none;2602 var resolve_inferred_alloc: Zir.Inst.Ref = .none;
2603 var opt_type_inst: Zir.Inst.Ref = .none;2603 var opt_type_inst: Zir.Inst.Ref = .none;
2604 if (var_decl.ast.type_node != 0) {2604 if (type_node != 0) {
2605 const type_inst = try typeExpr(gz, &init_scope.base, var_decl.ast.type_node);2605 const type_inst = try typeExpr(gz, &init_scope.base, type_node);
2606 opt_type_inst = type_inst;2606 opt_type_inst = type_inst;
2607 if (align_inst == .none) {2607 if (align_inst == .none) {
2608 init_scope.instructions_top = gz.instructions.items.len;2608 init_scope.instructions_top = gz.instructions.items.len;
...@@ -2683,7 +2683,7 @@ fn varDecl(...@@ -2683,7 +2683,7 @@ fn varDecl(
2683 const src_inst = gz.instructions.items[src];2683 const src_inst = gz.instructions.items[src];
2684 if (zir_tags[src_inst] == .store_to_block_ptr) {2684 if (zir_tags[src_inst] == .store_to_block_ptr) {
2685 if (zir_datas[src_inst].bin.lhs == init_scope.rl_ptr) {2685 if (zir_datas[src_inst].bin.lhs == init_scope.rl_ptr) {
2686 if (var_decl.ast.type_node != 0) {2686 if (type_node != 0) {
2687 zir_tags[src_inst] = .store;2687 zir_tags[src_inst] = .store;
2688 } else {2688 } else {
2689 zir_tags[src_inst] = .store_to_inferred_ptr;2689 zir_tags[src_inst] = .store_to_inferred_ptr;