authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-18 11:49:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-18 11:49:18-07:00
logde8f3bc885c7bfd1a084478c1302f0814d98bb62
tree9b53e9f1ad4d391e318e71a08b1bfafb7fe4024c
parent3e74acb1390e7b18a1d0febf9540585e165b52bd

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`.

1 files changed, 2 insertions(+), 5 deletions(-)

src/AstGen.zig+2-5
...@@ -1939,7 +1939,7 @@ fn blockExpr(...@@ -1939,7 +1939,7 @@ fn blockExpr(
1939 if (token_tags[lbrace - 1] == .colon and1939 if (token_tags[lbrace - 1] == .colon and
1940 token_tags[lbrace - 2] == .identifier)1940 token_tags[lbrace - 2] == .identifier)
1941 {1941 {
1942 return labeledBlockExpr(gz, scope, rl, block_node, statements, .block);1942 return labeledBlockExpr(gz, scope, rl, block_node, statements);
1943 }1943 }
19441944
1945 try blockExprStmts(gz, scope, statements);1945 try blockExprStmts(gz, scope, statements);
...@@ -1984,13 +1984,10 @@ fn labeledBlockExpr(...@@ -1984,13 +1984,10 @@ fn labeledBlockExpr(
1984 rl: ResultLoc,1984 rl: ResultLoc,
1985 block_node: Ast.Node.Index,1985 block_node: Ast.Node.Index,
1986 statements: []const Ast.Node.Index,1986 statements: []const Ast.Node.Index,
1987 zir_tag: Zir.Inst.Tag,
1988) InnerError!Zir.Inst.Ref {1987) InnerError!Zir.Inst.Ref {
1989 const tracy = trace(@src());1988 const tracy = trace(@src());
1990 defer tracy.end();1989 defer tracy.end();
19911990
1992 assert(zir_tag == .block);
1993
1994 const astgen = gz.astgen;1991 const astgen = gz.astgen;
1995 const tree = astgen.tree;1992 const tree = astgen.tree;
1996 const main_tokens = tree.nodes.items(.main_token);1993 const main_tokens = tree.nodes.items(.main_token);
...@@ -2004,7 +2001,7 @@ fn labeledBlockExpr(...@@ -2004,7 +2001,7 @@ fn labeledBlockExpr(
20042001
2005 // Reserve the Block ZIR instruction index so that we can put it into the GenZir struct2002 // Reserve the Block ZIR instruction index so that we can put it into the GenZir struct
2006 // so that break statements can reference it.2003 // so that break statements can reference it.
2007 const block_inst = try gz.makeBlockInst(zir_tag, block_node);2004 const block_inst = try gz.makeBlockInst(.block, block_node);
2008 try gz.instructions.append(astgen.gpa, block_inst);2005 try gz.instructions.append(astgen.gpa, block_inst);
20092006
2010 var block_scope = gz.makeSubBlock(parent_scope);2007 var block_scope = gz.makeSubBlock(parent_scope);