diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-24 15:57:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-24 15:57:44 -0400 |
| commit | 2a96209c4060bbf8a41fbe34e687a7a4741d2fe1 (patch) | |
| tree | 11594b42c723162c304f5cbce7259c856718458b /src/AstGen.zig | |
| parent | 80b8294bccdbdf3bc0dd9248676e5c9718354125 (diff) | |
| parent | 7b14d614d91df7b9b5d802f34bf628293fc714f0 (diff) | |
| download | zig-2a96209c4060bbf8a41fbe34e687a7a4741d2fe1.tar.gz zig-2a96209c4060bbf8a41fbe34e687a7a4741d2fe1.zip | |
Merge pull request #12574 from Vexu/remove-bit-op-type-param
stage2+stage1: remove type parameter from bit builtins
Diffstat (limited to 'src/AstGen.zig')
| -rw-r--r-- | src/AstGen.zig | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 2001e6950a..1924fb444b 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -7733,11 +7733,11 @@ fn builtinCall( .has_decl => return hasDeclOrField(gz, scope, rl, node, params[0], params[1], .has_decl), .has_field => return hasDeclOrField(gz, scope, rl, node, params[0], params[1], .has_field), - .clz => return bitBuiltin(gz, scope, rl, node, params[0], params[1], .clz), - .ctz => return bitBuiltin(gz, scope, rl, node, params[0], params[1], .ctz), - .pop_count => return bitBuiltin(gz, scope, rl, node, params[0], params[1], .pop_count), - .byte_swap => return bitBuiltin(gz, scope, rl, node, params[0], params[1], .byte_swap), - .bit_reverse => return bitBuiltin(gz, scope, rl, node, params[0], params[1], .bit_reverse), + .clz => return bitBuiltin(gz, scope, rl, node, params[0], .clz), + .ctz => return bitBuiltin(gz, scope, rl, node, params[0], .ctz), + .pop_count => return bitBuiltin(gz, scope, rl, node, params[0], .pop_count), + .byte_swap => return bitBuiltin(gz, scope, rl, node, params[0], .byte_swap), + .bit_reverse => return bitBuiltin(gz, scope, rl, node, params[0], .bit_reverse), .div_exact => return divBuiltin(gz, scope, rl, node, params[0], params[1], .div_exact), .div_floor => return divBuiltin(gz, scope, rl, node, params[0], params[1], .div_floor), @@ -8100,17 +8100,9 @@ fn bitBuiltin( scope: *Scope, rl: ResultLoc, node: Ast.Node.Index, - int_type_node: Ast.Node.Index, operand_node: Ast.Node.Index, tag: Zir.Inst.Tag, ) InnerError!Zir.Inst.Ref { - // The accepted proposal https://github.com/ziglang/zig/issues/6835 - // tells us to remove the type parameter from these builtins. To stay - // source-compatible with stage1, we still observe the parameter here, - // but we do not encode it into the ZIR. To implement this proposal in - // stage2, only AstGen code will need to be changed. - _ = try typeExpr(gz, scope, int_type_node); - const operand = try expr(gz, scope, .none, operand_node); const result = try gz.addUnNode(tag, operand, node); return rvalue(gz, rl, result, node); |
