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