authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 15:11:17-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 17:03:04-07:00
logd3ddb480756dc10b80e795db07aa5fcc7f9290d1
tree644c97f9e516e7e1615910a1d42ab9deca58ef44
parent06412e04f9f954f168b23a9bc6a1c03882055433

AstGen: remove unused parameters


1 files changed, 14 insertions(+), 39 deletions(-)

src/AstGen.zig+14-39
...@@ -597,10 +597,10 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr...@@ -597,10 +597,10 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
597 .asm_simple => return asmExpr(gz, scope, rl, node, tree.asmSimple(node)),597 .asm_simple => return asmExpr(gz, scope, rl, node, tree.asmSimple(node)),
598 .@"asm" => return asmExpr(gz, scope, rl, node, tree.asmFull(node)),598 .@"asm" => return asmExpr(gz, scope, rl, node, tree.asmFull(node)),
599599
600 .string_literal => return stringLiteral(gz, scope, rl, node),600 .string_literal => return stringLiteral(gz, rl, node),
601 .multiline_string_literal => return multilineStringLiteral(gz, scope, rl, node),601 .multiline_string_literal => return multilineStringLiteral(gz, rl, node),
602602
603 .integer_literal => return integerLiteral(gz, scope, rl, node),603 .integer_literal => return integerLiteral(gz, rl, node),
604 // zig fmt: on604 // zig fmt: on
605605
606 .builtin_call_two, .builtin_call_two_comma => {606 .builtin_call_two, .builtin_call_two_comma => {
...@@ -640,7 +640,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr...@@ -640,7 +640,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
640 },640 },
641 .@"return" => return ret(gz, scope, node),641 .@"return" => return ret(gz, scope, node),
642 .field_access => return fieldAccess(gz, scope, rl, node),642 .field_access => return fieldAccess(gz, scope, rl, node),
643 .float_literal => return floatLiteral(gz, scope, rl, node),643 .float_literal => return floatLiteral(gz, rl, node),
644644
645 .if_simple => return ifExpr(gz, scope, rl, node, tree.ifSimple(node)),645 .if_simple => return ifExpr(gz, scope, rl, node, tree.ifSimple(node)),
646 .@"if" => return ifExpr(gz, scope, rl, node, tree.ifFull(node)),646 .@"if" => return ifExpr(gz, scope, rl, node, tree.ifFull(node)),
...@@ -737,8 +737,8 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr...@@ -737,8 +737,8 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
737 const statements = tree.extra_data[node_datas[node].lhs..node_datas[node].rhs];737 const statements = tree.extra_data[node_datas[node].lhs..node_datas[node].rhs];
738 return blockExpr(gz, scope, rl, node, statements);738 return blockExpr(gz, scope, rl, node, statements);
739 },739 },
740 .enum_literal => return simpleStrTok(gz, scope, rl, main_tokens[node], node, .enum_literal),740 .enum_literal => return simpleStrTok(gz, rl, main_tokens[node], node, .enum_literal),
741 .error_value => return simpleStrTok(gz, scope, rl, node_datas[node].rhs, node, .error_value),741 .error_value => return simpleStrTok(gz, rl, node_datas[node].rhs, node, .error_value),
742 .anyframe_literal => return rvalue(gz, rl, .anyframe_type, node),742 .anyframe_literal => return rvalue(gz, rl, .anyframe_type, node),
743 .anyframe_type => {743 .anyframe_type => {
744 const return_type = try typeExpr(gz, scope, node_datas[node].rhs);744 const return_type = try typeExpr(gz, scope, node_datas[node].rhs);
...@@ -837,8 +837,8 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr...@@ -837,8 +837,8 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
837 .grouped_expression => return expr(gz, scope, rl, node_datas[node].lhs),837 .grouped_expression => return expr(gz, scope, rl, node_datas[node].lhs),
838 .array_type => return arrayType(gz, scope, rl, node),838 .array_type => return arrayType(gz, scope, rl, node),
839 .array_type_sentinel => return arrayTypeSentinel(gz, scope, rl, node),839 .array_type_sentinel => return arrayTypeSentinel(gz, scope, rl, node),
840 .char_literal => return charLiteral(gz, scope, rl, node),840 .char_literal => return charLiteral(gz, rl, node),
841 .error_set_decl => return errorSetDecl(gz, scope, rl, node),841 .error_set_decl => return errorSetDecl(gz, rl, node),
842 .array_access => return arrayAccess(gz, scope, rl, node),842 .array_access => return arrayAccess(gz, scope, rl, node),
843 .@"comptime" => return comptimeExprAst(gz, scope, rl, node),843 .@"comptime" => return comptimeExprAst(gz, scope, rl, node),
844 .@"switch", .switch_comma => return switchExpr(gz, scope, rl, node),844 .@"switch", .switch_comma => return switchExpr(gz, scope, rl, node),
...@@ -4458,12 +4458,7 @@ fn containerDecl(...@@ -4458,12 +4458,7 @@ fn containerDecl(
4458 }4458 }
4459}4459}
44604460
4461fn errorSetDecl(4461fn errorSetDecl(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
4462 gz: *GenZir,
4463 scope: *Scope,
4464 rl: ResultLoc,
4465 node: ast.Node.Index,
4466) InnerError!Zir.Inst.Ref {
4467 const astgen = gz.astgen;4462 const astgen = gz.astgen;
4468 const gpa = astgen.gpa;4463 const gpa = astgen.gpa;
4469 const tree = astgen.tree;4464 const tree = astgen.tree;
...@@ -4559,7 +4554,6 @@ fn tryExpr(...@@ -4559,7 +4554,6 @@ fn tryExpr(
45594554
4560 return finishThenElseBlock(4555 return finishThenElseBlock(
4561 parent_gz,4556 parent_gz,
4562 scope,
4563 rl,4557 rl,
4564 node,4558 node,
4565 &block_scope,4559 &block_scope,
...@@ -4652,7 +4646,6 @@ fn orelseCatchExpr(...@@ -4652,7 +4646,6 @@ fn orelseCatchExpr(
46524646
4653 return finishThenElseBlock(4647 return finishThenElseBlock(
4654 parent_gz,4648 parent_gz,
4655 scope,
4656 rl,4649 rl,
4657 node,4650 node,
4658 &block_scope,4651 &block_scope,
...@@ -4670,7 +4663,6 @@ fn orelseCatchExpr(...@@ -4670,7 +4663,6 @@ fn orelseCatchExpr(
46704663
4671fn finishThenElseBlock(4664fn finishThenElseBlock(
4672 parent_gz: *GenZir,4665 parent_gz: *GenZir,
4673 parent_scope: *Scope,
4674 rl: ResultLoc,4666 rl: ResultLoc,
4675 node: ast.Node.Index,4667 node: ast.Node.Index,
4676 block_scope: *GenZir,4668 block_scope: *GenZir,
...@@ -4805,7 +4797,6 @@ fn simpleBinOp(...@@ -4805,7 +4797,6 @@ fn simpleBinOp(
48054797
4806fn simpleStrTok(4798fn simpleStrTok(
4807 gz: *GenZir,4799 gz: *GenZir,
4808 scope: *Scope,
4809 rl: ResultLoc,4800 rl: ResultLoc,
4810 ident_token: ast.TokenIndex,4801 ident_token: ast.TokenIndex,
4811 node: ast.Node.Index,4802 node: ast.Node.Index,
...@@ -5005,7 +4996,6 @@ fn ifExpr(...@@ -5005,7 +4996,6 @@ fn ifExpr(
50054996
5006 return finishThenElseBlock(4997 return finishThenElseBlock(
5007 parent_gz,4998 parent_gz,
5008 scope,
5009 rl,4999 rl,
5010 node,5000 node,
5011 &block_scope,5001 &block_scope,
...@@ -5285,7 +5275,6 @@ fn whileExpr(...@@ -5285,7 +5275,6 @@ fn whileExpr(
5285 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";5275 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";
5286 return finishThenElseBlock(5276 return finishThenElseBlock(
5287 parent_gz,5277 parent_gz,
5288 scope,
5289 rl,5278 rl,
5290 node,5279 node,
5291 &loop_scope,5280 &loop_scope,
...@@ -5459,7 +5448,6 @@ fn forExpr(...@@ -5459,7 +5448,6 @@ fn forExpr(
5459 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";5448 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";
5460 return finishThenElseBlock(5449 return finishThenElseBlock(
5461 parent_gz,5450 parent_gz,
5462 scope,
5463 rl,5451 rl,
5464 node,5452 node,
5465 &loop_scope,5453 &loop_scope,
...@@ -6261,7 +6249,6 @@ fn identifier(...@@ -6261,7 +6249,6 @@ fn identifier(
62616249
6262fn stringLiteral(6250fn stringLiteral(
6263 gz: *GenZir,6251 gz: *GenZir,
6264 scope: *Scope,
6265 rl: ResultLoc,6252 rl: ResultLoc,
6266 node: ast.Node.Index,6253 node: ast.Node.Index,
6267) InnerError!Zir.Inst.Ref {6254) InnerError!Zir.Inst.Ref {
...@@ -6282,7 +6269,6 @@ fn stringLiteral(...@@ -6282,7 +6269,6 @@ fn stringLiteral(
62826269
6283fn multilineStringLiteral(6270fn multilineStringLiteral(
6284 gz: *GenZir,6271 gz: *GenZir,
6285 scope: *Scope,
6286 rl: ResultLoc,6272 rl: ResultLoc,
6287 node: ast.Node.Index,6273 node: ast.Node.Index,
6288) InnerError!Zir.Inst.Ref {6274) InnerError!Zir.Inst.Ref {
...@@ -6323,7 +6309,7 @@ fn multilineStringLiteral(...@@ -6323,7 +6309,7 @@ fn multilineStringLiteral(
6323 return rvalue(gz, rl, result, node);6309 return rvalue(gz, rl, result, node);
6324}6310}
63256311
6326fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) !Zir.Inst.Ref {6312fn charLiteral(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) !Zir.Inst.Ref {
6327 const astgen = gz.astgen;6313 const astgen = gz.astgen;
6328 const tree = astgen.tree;6314 const tree = astgen.tree;
6329 const main_tokens = tree.nodes.items(.main_token);6315 const main_tokens = tree.nodes.items(.main_token);
...@@ -6346,12 +6332,7 @@ fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index)...@@ -6346,12 +6332,7 @@ fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index)
6346 return rvalue(gz, rl, result, node);6332 return rvalue(gz, rl, result, node);
6347}6333}
63486334
6349fn integerLiteral(6335fn integerLiteral(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
6350 gz: *GenZir,
6351 scope: *Scope,
6352 rl: ResultLoc,
6353 node: ast.Node.Index,
6354) InnerError!Zir.Inst.Ref {
6355 const astgen = gz.astgen;6336 const astgen = gz.astgen;
6356 const tree = astgen.tree;6337 const tree = astgen.tree;
6357 const main_tokens = tree.nodes.items(.main_token);6338 const main_tokens = tree.nodes.items(.main_token);
...@@ -6397,12 +6378,7 @@ fn integerLiteral(...@@ -6397,12 +6378,7 @@ fn integerLiteral(
6397 return rvalue(gz, rl, result, node);6378 return rvalue(gz, rl, result, node);
6398}6379}
63996380
6400fn floatLiteral(6381fn floatLiteral(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
6401 gz: *GenZir,
6402 scope: *Scope,
6403 rl: ResultLoc,
6404 node: ast.Node.Index,
6405) InnerError!Zir.Inst.Ref {
6406 const astgen = gz.astgen;6382 const astgen = gz.astgen;
6407 const tree = astgen.tree;6383 const tree = astgen.tree;
6408 const main_tokens = tree.nodes.items(.main_token);6384 const main_tokens = tree.nodes.items(.main_token);
...@@ -6904,8 +6880,8 @@ fn builtinCall(...@@ -6904,8 +6880,8 @@ fn builtinCall(
6904 return rvalue(gz, rl, result, node);6880 return rvalue(gz, rl, result, node);
6905 },6881 },
69066882
6907 .breakpoint => return simpleNoOpVoid(gz, scope, rl, node, .breakpoint),6883 .breakpoint => return simpleNoOpVoid(gz, rl, node, .breakpoint),
6908 .fence => return simpleNoOpVoid(gz, scope, rl, node, .fence),6884 .fence => return simpleNoOpVoid(gz, rl, node, .fence),
69096885
6910 .This => return rvalue(gz, rl, try gz.addNodeExtended(.this, node), node),6886 .This => return rvalue(gz, rl, try gz.addNodeExtended(.this, node), node),
6911 .return_address => return rvalue(gz, rl, try gz.addNodeExtended(.ret_addr, node), node),6887 .return_address => return rvalue(gz, rl, try gz.addNodeExtended(.ret_addr, node), node),
...@@ -7218,7 +7194,6 @@ fn builtinCall(...@@ -7218,7 +7194,6 @@ fn builtinCall(
72187194
7219fn simpleNoOpVoid(7195fn simpleNoOpVoid(
7220 gz: *GenZir,7196 gz: *GenZir,
7221 scope: *Scope,
7222 rl: ResultLoc,7197 rl: ResultLoc,
7223 node: ast.Node.Index,7198 node: ast.Node.Index,
7224 tag: Zir.Inst.Tag,7199 tag: Zir.Inst.Tag,