From df4849c4f5aafc7eb80fd7b2299b49162fa2aa79 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 5 May 2023 16:07:27 -0400 Subject: AstGen: cleanup previous fix Allocating an extended tag is much cleaner and easier to reason about than reusing an existing tag. The previous `.data = undefined` was a clear indication that we don't have any data to store, and so might as well store an extended tag in that space almost for free. --- src/Zir.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Zir.zig') diff --git a/src/Zir.zig b/src/Zir.zig index 51c90c61cb..7f9681e533 100644 --- a/src/Zir.zig +++ b/src/Zir.zig @@ -1979,7 +1979,7 @@ pub const Inst = struct { /// `operand` is `src_node: i32`. breakpoint, /// Implements the `@select` builtin. - /// operand` is payload index to `Select`. + /// `operand` is payload index to `Select`. select, /// Implement builtin `@errToInt`. /// `operand` is payload index to `UnNode`. @@ -1999,7 +1999,7 @@ pub const Inst = struct { /// `operand` is payload index to `Cmpxchg`. cmpxchg, /// Implement the builtin `@addrSpaceCast` - /// `Operand` is payload index to `BinNode`. `lhs` is dest type, `rhs` is operand. + /// `operand` is payload index to `BinNode`. `lhs` is dest type, `rhs` is operand. addrspace_cast, /// Implement builtin `@cVaArg`. /// `operand` is payload index to `BinNode`. @@ -2031,6 +2031,9 @@ pub const Inst = struct { /// Implements the `@inComptime` builtin. /// `operand` is `src_node: i32`. in_comptime, + /// Used as a placeholder for the capture of an `errdefer`. + /// This is replaced by Sema with the captured value. + errdefer_err_code, pub const InstData = struct { opcode: Extended, -- cgit v1.2.3