authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-07-13 01:10:13-04:00
committergravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-07-13 01:49:04-04:00
loga124b027b45384e595c6967adabe8b5033b9c410
tree6a3dc13e7e60c4c1098d7193d7dc8f0558de5e16
parent3bad1c16ccbe9d77df373a0dbbe934dccac13175
signaturelock-open Commit is signed but in an unrecognized format.

CBE: Use hasCodeGenBits instead of checking against void and noreturn


1 files changed, 1 insertions(+), 2 deletions(-)

src-self-hosted/cgen.zig+1-2
......@@ -126,8 +126,7 @@ pub fn generate(file: *C, decl: *Decl) !void {
126126 const target = func_val.func.owner_decl;
127127 const target_ty = target.typed_value.most_recent.typed_value.ty;
128128 const ret_ty = target_ty.fnReturnType().tag();
129 if (ret_ty != .void and ret_ty != .noreturn) {
130 // TODO: don't do this if we're actually using the value
129 if (target_ty.fnReturnType().hasCodeGenBits()) {
131130 try writer.print("(void)", .{});
132131 }
133132 const tname = mem.spanZ(target.name);