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
597597 .asm_simple => return asmExpr(gz, scope, rl, node, tree.asmSimple(node)),
598598 .@"asm" => return asmExpr(gz, scope, rl, node, tree.asmFull(node)),
599599
600 .string_literal => return stringLiteral(gz, scope, rl, node),
601 .multiline_string_literal => return multilineStringLiteral(gz, scope, rl, node),
600 .string_literal => return stringLiteral(gz, 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),
604604 // zig fmt: on
605605
606606 .builtin_call_two, .builtin_call_two_comma => {
......@@ -640,7 +640,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
640640 },
641641 .@"return" => return ret(gz, scope, node),
642642 .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
645645 .if_simple => return ifExpr(gz, scope, rl, node, tree.ifSimple(node)),
646646 .@"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
737737 const statements = tree.extra_data[node_datas[node].lhs..node_datas[node].rhs];
738738 return blockExpr(gz, scope, rl, node, statements);
739739 },
740 .enum_literal => return simpleStrTok(gz, scope, rl, main_tokens[node], node, .enum_literal),
741 .error_value => return simpleStrTok(gz, scope, rl, node_datas[node].rhs, node, .error_value),
740 .enum_literal => return simpleStrTok(gz, rl, main_tokens[node], node, .enum_literal),
741 .error_value => return simpleStrTok(gz, rl, node_datas[node].rhs, node, .error_value),
742742 .anyframe_literal => return rvalue(gz, rl, .anyframe_type, node),
743743 .anyframe_type => {
744744 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
837837 .grouped_expression => return expr(gz, scope, rl, node_datas[node].lhs),
838838 .array_type => return arrayType(gz, scope, rl, node),
839839 .array_type_sentinel => return arrayTypeSentinel(gz, scope, rl, node),
840 .char_literal => return charLiteral(gz, scope, rl, node),
841 .error_set_decl => return errorSetDecl(gz, scope, rl, node),
840 .char_literal => return charLiteral(gz, rl, node),
841 .error_set_decl => return errorSetDecl(gz, rl, node),
842842 .array_access => return arrayAccess(gz, scope, rl, node),
843843 .@"comptime" => return comptimeExprAst(gz, scope, rl, node),
844844 .@"switch", .switch_comma => return switchExpr(gz, scope, rl, node),
......@@ -4458,12 +4458,7 @@ fn containerDecl(
44584458 }
44594459}
44604460
4461fn errorSetDecl(
4462 gz: *GenZir,
4463 scope: *Scope,
4464 rl: ResultLoc,
4465 node: ast.Node.Index,
4466) InnerError!Zir.Inst.Ref {
4461fn errorSetDecl(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
44674462 const astgen = gz.astgen;
44684463 const gpa = astgen.gpa;
44694464 const tree = astgen.tree;
......@@ -4559,7 +4554,6 @@ fn tryExpr(
45594554
45604555 return finishThenElseBlock(
45614556 parent_gz,
4562 scope,
45634557 rl,
45644558 node,
45654559 &block_scope,
......@@ -4652,7 +4646,6 @@ fn orelseCatchExpr(
46524646
46534647 return finishThenElseBlock(
46544648 parent_gz,
4655 scope,
46564649 rl,
46574650 node,
46584651 &block_scope,
......@@ -4670,7 +4663,6 @@ fn orelseCatchExpr(
46704663
46714664fn finishThenElseBlock(
46724665 parent_gz: *GenZir,
4673 parent_scope: *Scope,
46744666 rl: ResultLoc,
46754667 node: ast.Node.Index,
46764668 block_scope: *GenZir,
......@@ -4805,7 +4797,6 @@ fn simpleBinOp(
48054797
48064798fn simpleStrTok(
48074799 gz: *GenZir,
4808 scope: *Scope,
48094800 rl: ResultLoc,
48104801 ident_token: ast.TokenIndex,
48114802 node: ast.Node.Index,
......@@ -5005,7 +4996,6 @@ fn ifExpr(
50054996
50064997 return finishThenElseBlock(
50074998 parent_gz,
5008 scope,
50094999 rl,
50105000 node,
50115001 &block_scope,
......@@ -5285,7 +5275,6 @@ fn whileExpr(
52855275 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";
52865276 return finishThenElseBlock(
52875277 parent_gz,
5288 scope,
52895278 rl,
52905279 node,
52915280 &loop_scope,
......@@ -5459,7 +5448,6 @@ fn forExpr(
54595448 const break_tag: Zir.Inst.Tag = if (is_inline) .break_inline else .@"break";
54605449 return finishThenElseBlock(
54615450 parent_gz,
5462 scope,
54635451 rl,
54645452 node,
54655453 &loop_scope,
......@@ -6261,7 +6249,6 @@ fn identifier(
62616249
62626250fn stringLiteral(
62636251 gz: *GenZir,
6264 scope: *Scope,
62656252 rl: ResultLoc,
62666253 node: ast.Node.Index,
62676254) InnerError!Zir.Inst.Ref {
......@@ -6282,7 +6269,6 @@ fn stringLiteral(
62826269
62836270fn multilineStringLiteral(
62846271 gz: *GenZir,
6285 scope: *Scope,
62866272 rl: ResultLoc,
62876273 node: ast.Node.Index,
62886274) InnerError!Zir.Inst.Ref {
......@@ -6323,7 +6309,7 @@ fn multilineStringLiteral(
63236309 return rvalue(gz, rl, result, node);
63246310}
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 {
63276313 const astgen = gz.astgen;
63286314 const tree = astgen.tree;
63296315 const main_tokens = tree.nodes.items(.main_token);
......@@ -6346,12 +6332,7 @@ fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index)
63466332 return rvalue(gz, rl, result, node);
63476333}
63486334
6349fn integerLiteral(
6350 gz: *GenZir,
6351 scope: *Scope,
6352 rl: ResultLoc,
6353 node: ast.Node.Index,
6354) InnerError!Zir.Inst.Ref {
6335fn integerLiteral(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
63556336 const astgen = gz.astgen;
63566337 const tree = astgen.tree;
63576338 const main_tokens = tree.nodes.items(.main_token);
......@@ -6397,12 +6378,7 @@ fn integerLiteral(
63976378 return rvalue(gz, rl, result, node);
63986379}
63996380
6400fn floatLiteral(
6401 gz: *GenZir,
6402 scope: *Scope,
6403 rl: ResultLoc,
6404 node: ast.Node.Index,
6405) InnerError!Zir.Inst.Ref {
6381fn floatLiteral(gz: *GenZir, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
64066382 const astgen = gz.astgen;
64076383 const tree = astgen.tree;
64086384 const main_tokens = tree.nodes.items(.main_token);
......@@ -6904,8 +6880,8 @@ fn builtinCall(
69046880 return rvalue(gz, rl, result, node);
69056881 },
69066882
6907 .breakpoint => return simpleNoOpVoid(gz, scope, rl, node, .breakpoint),
6908 .fence => return simpleNoOpVoid(gz, scope, rl, node, .fence),
6883 .breakpoint => return simpleNoOpVoid(gz, rl, node, .breakpoint),
6884 .fence => return simpleNoOpVoid(gz, rl, node, .fence),
69096885
69106886 .This => return rvalue(gz, rl, try gz.addNodeExtended(.this, node), node),
69116887 .return_address => return rvalue(gz, rl, try gz.addNodeExtended(.ret_addr, node), node),
......@@ -7218,7 +7194,6 @@ fn builtinCall(
72187194
72197195fn simpleNoOpVoid(
72207196 gz: *GenZir,
7221 scope: *Scope,
72227197 rl: ResultLoc,
72237198 node: ast.Node.Index,
72247199 tag: Zir.Inst.Tag,