| ... | @@ -2291,15 +2291,15 @@ pub const DeclGen = struct { | ... | @@ -2291,15 +2291,15 @@ pub const DeclGen = struct { |
| 2291 | return null; | 2291 | return null; |
| 2292 | | 2292 | |
| 2293 | // Combine the result from the blocks using the Phi instruction. | 2293 | // Combine the result from the blocks using the Phi instruction. |
| 2294 | | | |
| 2295 | const result_id = self.spv.allocId(); | 2294 | const result_id = self.spv.allocId(); |
| 2296 | | 2295 | |
| 2297 | // TODO: OpPhi is limited in the types that it may produce, such as pointers. Figure out which other types | 2296 | // TODO: OpPhi is limited in the types that it may produce, such as pointers. Figure out which other types |
| 2298 | // are not allowed to be created from a phi node, and throw an error for those. | 2297 | // are not allowed to be created from a phi node, and throw an error for those. |
| 2299 | const result_type_id = try self.resolveTypeId(ty); | 2298 | const result_type_id = try self.resolveTypeId(ty); |
| 2300 | _ = result_type_id; | | |
| 2301 | | 2299 | |
| 2302 | try self.func.body.emitRaw(self.spv.gpa, .OpPhi, 2 + @intCast(u16, incoming_blocks.items.len * 2)); // result type + result + variable/parent... | 2300 | try self.func.body.emitRaw(self.spv.gpa, .OpPhi, 2 + @intCast(u16, incoming_blocks.items.len * 2)); // result type + result + variable/parent... |
| | 2301 | self.func.body.writeOperand(spec.IdResultType, result_type_id); |
| | 2302 | self.func.body.writeOperand(spec.IdRef, result_id); |
| 2303 | | 2303 | |
| 2304 | for (incoming_blocks.items) |incoming| { | 2304 | for (incoming_blocks.items) |incoming| { |
| 2305 | self.func.body.writeOperand(spec.PairIdRefIdRef, .{ incoming.break_value_id, incoming.src_label_id }); | 2305 | self.func.body.writeOperand(spec.PairIdRefIdRef, .{ incoming.break_value_id, incoming.src_label_id }); |