| ... | ... | @@ -300,6 +300,7 @@ pub const Inst = struct { |
| 300 | 300 | => NoOp, |
| 301 | 301 | |
| 302 | 302 | .boolnot, |
| 303 | .compileerror, |
| 303 | 304 | .deref, |
| 304 | 305 | .@"return", |
| 305 | 306 | .isnull, |
| ... | ... | @@ -387,7 +388,6 @@ pub const Inst = struct { |
| 387 | 388 | .declval => DeclVal, |
| 388 | 389 | .declval_in_module => DeclValInModule, |
| 389 | 390 | .coerce_result_block_ptr => CoerceResultBlockPtr, |
| 390 | | .compileerror => CompileError, |
| 391 | 391 | .compilelog => CompileLog, |
| 392 | 392 | .loop => Loop, |
| 393 | 393 | .@"const" => Const, |
| ... | ... | @@ -701,16 +701,6 @@ pub const Inst = struct { |
| 701 | 701 | kw_args: struct {}, |
| 702 | 702 | }; |
| 703 | 703 | |
| 704 | | pub const CompileError = struct { |
| 705 | | pub const base_tag = Tag.compileerror; |
| 706 | | base: Inst, |
| 707 | | |
| 708 | | positionals: struct { |
| 709 | | msg: *Inst, |
| 710 | | }, |
| 711 | | kw_args: struct {}, |
| 712 | | }; |
| 713 | | |
| 714 | 704 | pub const CompileLog = struct { |
| 715 | 705 | pub const base_tag = Tag.compilelog; |
| 716 | 706 | base: Inst, |
| ... | ... | @@ -1943,14 +1933,14 @@ const EmitZIR = struct { |
| 1943 | 1933 | .sema_failure_retryable, |
| 1944 | 1934 | .dependency_failure, |
| 1945 | 1935 | => if (self.old_module.failed_decls.get(ir_decl)) |err_msg_list| { |
| 1946 | | const fail_inst = try self.arena.allocator.create(Inst.CompileError); |
| 1936 | const fail_inst = try self.arena.allocator.create(Inst.UnOp); |
| 1947 | 1937 | fail_inst.* = .{ |
| 1948 | 1938 | .base = .{ |
| 1949 | 1939 | .src = ir_decl.src(), |
| 1950 | | .tag = Inst.CompileError.base_tag, |
| 1940 | .tag = .compileerror, |
| 1951 | 1941 | }, |
| 1952 | 1942 | .positionals = .{ |
| 1953 | | .msg = blk: { |
| 1943 | .operand = blk: { |
| 1954 | 1944 | const msg_str = try self.arena.allocator.dupe(u8, err_msg_list.items[0].msg); |
| 1955 | 1945 | |
| 1956 | 1946 | const str_inst = try self.arena.allocator.create(Inst.Str); |
| ... | ... | @@ -2088,14 +2078,14 @@ const EmitZIR = struct { |
| 2088 | 2078 | }, |
| 2089 | 2079 | .sema_failure => { |
| 2090 | 2080 | const err_msg = self.old_module.failed_decls.get(module_fn.owner_decl).?.items[0]; |
| 2091 | | const fail_inst = try self.arena.allocator.create(Inst.CompileError); |
| 2081 | const fail_inst = try self.arena.allocator.create(Inst.UnOp); |
| 2092 | 2082 | fail_inst.* = .{ |
| 2093 | 2083 | .base = .{ |
| 2094 | 2084 | .src = src, |
| 2095 | | .tag = Inst.CompileError.base_tag, |
| 2085 | .tag = .compileerror, |
| 2096 | 2086 | }, |
| 2097 | 2087 | .positionals = .{ |
| 2098 | | .msg = blk: { |
| 2088 | .operand = blk: { |
| 2099 | 2089 | const msg_str = try self.arena.allocator.dupe(u8, err_msg.msg); |
| 2100 | 2090 | |
| 2101 | 2091 | const str_inst = try self.arena.allocator.create(Inst.Str); |
| ... | ... | @@ -2117,14 +2107,14 @@ const EmitZIR = struct { |
| 2117 | 2107 | try instructions.append(&fail_inst.base); |
| 2118 | 2108 | }, |
| 2119 | 2109 | .dependency_failure => { |
| 2120 | | const fail_inst = try self.arena.allocator.create(Inst.CompileError); |
| 2110 | const fail_inst = try self.arena.allocator.create(Inst.UnOp); |
| 2121 | 2111 | fail_inst.* = .{ |
| 2122 | 2112 | .base = .{ |
| 2123 | 2113 | .src = src, |
| 2124 | | .tag = Inst.CompileError.base_tag, |
| 2114 | .tag = .compileerror, |
| 2125 | 2115 | }, |
| 2126 | 2116 | .positionals = .{ |
| 2127 | | .msg = blk: { |
| 2117 | .operand = blk: { |
| 2128 | 2118 | const msg_str = try self.arena.allocator.dupe(u8, "depends on another failed Decl"); |
| 2129 | 2119 | |
| 2130 | 2120 | const str_inst = try self.arena.allocator.create(Inst.Str); |