| ... | @@ -126,8 +126,7 @@ pub fn generate(file: *C, decl: *Decl) !void { | ... | @@ -126,8 +126,7 @@ pub fn generate(file: *C, decl: *Decl) !void { |
| 126 | const target = func_val.func.owner_decl; | 126 | const target = func_val.func.owner_decl; |
| 127 | const target_ty = target.typed_value.most_recent.typed_value.ty; | 127 | const target_ty = target.typed_value.most_recent.typed_value.ty; |
| 128 | const ret_ty = target_ty.fnReturnType().tag(); | 128 | const ret_ty = target_ty.fnReturnType().tag(); |
| 129 | if (ret_ty != .void and ret_ty != .noreturn) { | 129 | if (target_ty.fnReturnType().hasCodeGenBits()) { |
| 130 | // TODO: don't do this if we're actually using the value | | |
| 131 | try writer.print("(void)", .{}); | 130 | try writer.print("(void)", .{}); |
| 132 | } | 131 | } |
| 133 | const tname = mem.spanZ(target.name); | 132 | const tname = mem.spanZ(target.name); |