mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 22:09:49 +00:00
CBE: Use hasCodeGenBits instead of checking against void and noreturn
This commit is contained in:
parent
3bad1c16cc
commit
a124b027b4
@ -126,8 +126,7 @@ pub fn generate(file: *C, decl: *Decl) !void {
|
||||
const target = func_val.func.owner_decl;
|
||||
const target_ty = target.typed_value.most_recent.typed_value.ty;
|
||||
const ret_ty = target_ty.fnReturnType().tag();
|
||||
if (ret_ty != .void and ret_ty != .noreturn) {
|
||||
// TODO: don't do this if we're actually using the value
|
||||
if (target_ty.fnReturnType().hasCodeGenBits()) {
|
||||
try writer.print("(void)", .{});
|
||||
}
|
||||
const tname = mem.spanZ(target.name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user