aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index e78bd8d103..cd601debda 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -727,6 +727,11 @@ pub const FuncGen = struct {
}
fn genRet(self: *FuncGen, inst: *Inst.UnOp) !?*const llvm.Value {
+ if (!inst.operand.ty.hasCodeGenBits()) {
+ // TODO: in astgen these instructions should turn into `retvoid` instructions.
+ _ = self.builder.buildRetVoid();
+ return null;
+ }
_ = self.builder.buildRet(try self.resolveInst(inst.operand));
return null;
}