diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-18 11:49:18 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-18 11:49:18 -0700 |
| commit | de8f3bc885c7bfd1a084478c1302f0814d98bb62 (patch) | |
| tree | 9b53e9f1ad4d391e318e71a08b1bfafb7fe4024c /src/AstGen.zig | |
| parent | 3e74acb1390e7b18a1d0febf9540585e165b52bd (diff) | |
| download | zig-de8f3bc885c7bfd1a084478c1302f0814d98bb62.tar.gz zig-de8f3bc885c7bfd1a084478c1302f0814d98bb62.zip | |
AstGen: remove unused parameter
This function took a parameter that was only ever used with one value,
obscuring the fact that it was a regular `block` which should be used with
`.break` and not `.break_inline`.
Diffstat (limited to 'src/AstGen.zig')
| -rw-r--r-- | src/AstGen.zig | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 88b2b3544c..742f13214c 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -1939,7 +1939,7 @@ fn blockExpr( if (token_tags[lbrace - 1] == .colon and token_tags[lbrace - 2] == .identifier) { - return labeledBlockExpr(gz, scope, rl, block_node, statements, .block); + return labeledBlockExpr(gz, scope, rl, block_node, statements); } try blockExprStmts(gz, scope, statements); @@ -1984,13 +1984,10 @@ fn labeledBlockExpr( rl: ResultLoc, block_node: Ast.Node.Index, statements: []const Ast.Node.Index, - zir_tag: Zir.Inst.Tag, ) InnerError!Zir.Inst.Ref { const tracy = trace(@src()); defer tracy.end(); - assert(zir_tag == .block); - const astgen = gz.astgen; const tree = astgen.tree; const main_tokens = tree.nodes.items(.main_token); @@ -2004,7 +2001,7 @@ fn labeledBlockExpr( // Reserve the Block ZIR instruction index so that we can put it into the GenZir struct // so that break statements can reference it. - const block_inst = try gz.makeBlockInst(zir_tag, block_node); + const block_inst = try gz.makeBlockInst(.block, block_node); try gz.instructions.append(astgen.gpa, block_inst); var block_scope = gz.makeSubBlock(parent_scope); |
