aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 51bb713ed5..bc5f5ca7c7 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -4025,7 +4025,7 @@ pub const FuncGen = struct {
if (self.liveness.isUnused(inst)) return null;
const ptr_ty = self.air.typeOfIndex(inst);
const ret_ty = ptr_ty.childType();
- if (!ret_ty.isFnOrHasRuntimeBits()) return null;
+ if (!ret_ty.isFnOrHasRuntimeBits()) return self.dg.lowerPtrToVoid(ptr_ty);
if (self.ret_ptr) |ret_ptr| return ret_ptr;
const ret_llvm_ty = try self.dg.llvmType(ret_ty);
const target = self.dg.module.getTarget();
@@ -4845,6 +4845,7 @@ pub const FuncGen = struct {
struct_ptr_ty: Type,
field_index: u32,
) !?*const llvm.Value {
+ if (self.liveness.isUnused(inst)) return null;
const struct_ty = struct_ptr_ty.childType();
switch (struct_ty.zigTypeTag()) {
.Struct => switch (struct_ty.containerLayout()) {