diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-12-27 17:56:33 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-27 17:56:33 -0700 |
| commit | 9dd4fb4130a71d2aaaaa361d8ee0b7135cb84162 (patch) | |
| tree | 569ebd4a536b1df12976d6c6c19e3725ef6b7e98 /src/Sema.zig | |
| parent | 886df772f06377df95f867e8b18ee47bbd0fcd8b (diff) | |
| download | zig-9dd4fb4130a71d2aaaaa361d8ee0b7135cb84162.tar.gz zig-9dd4fb4130a71d2aaaaa361d8ee0b7135cb84162.zip | |
stage2: fix 0-bit function parameters
Before this commit, Zig would incorrectly emit `arg` AIR instructions
for parameters whose types were 0-bit.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index d273d1d6e8..f1431272db 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -266,7 +266,7 @@ pub const Block = struct { }); } - pub fn addBinOp( + fn addBinOp( block: *Block, tag: Air.Inst.Tag, lhs: Air.Inst.Ref, @@ -281,7 +281,7 @@ pub const Block = struct { }); } - pub fn addArg(block: *Block, ty: Type, name: u32) error{OutOfMemory}!Air.Inst.Ref { + fn addArg(block: *Block, ty: Type, name: u32) error{OutOfMemory}!Air.Inst.Ref { return block.addInst(.{ .tag = .arg, .data = .{ .ty_str = .{ @@ -291,7 +291,7 @@ pub const Block = struct { }); } - pub fn addStructFieldPtr( + fn addStructFieldPtr( block: *Block, struct_ptr: Air.Inst.Ref, field_index: u32, @@ -15339,7 +15339,7 @@ fn getBuiltinType( /// in `Sema` is for calling during semantic analysis, and performs field resolution /// to get the answer. The one in `Type` is for calling during codegen and asserts /// that the types are already resolved. -fn typeHasOnePossibleValue( +pub fn typeHasOnePossibleValue( sema: *Sema, block: *Block, src: LazySrcLoc, |
