aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2021-09-06 00:29:04 +0200
committerRobin Voetter <robin@voetter.nl>2021-09-20 02:29:04 +0200
commit95e83afa98c5af89c6e5f40d559eb54c6c31a54e (patch)
treef1616f0a6a546a0ff7434b56b6efd1d0a3213c0f /src/codegen
parent5a142dfa5651ec21792de211a6e9341c31ab4dbb (diff)
downloadzig-95e83afa98c5af89c6e5f40d559eb54c6c31a54e.tar.gz
zig-95e83afa98c5af89c6e5f40d559eb54c6c31a54e.zip
Address Spaces: Yeet address space on function prototypes
This is a property which solely belongs to pointers to functions, not to the functions themselves. This cannot be properly represented by stage 2 at the moment, as type with zigTypeTag() == .Fn is overloaded for for function pointers and function prototypes.
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 ce79d43fac..e2d6e964cf 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -700,7 +700,8 @@ pub const DeclGen = struct {
@intCast(c_uint, llvm_params.len),
llvm.Bool.fromBool(is_var_args),
);
- const llvm_addrspace = self.llvmAddressSpace(t.fnAddressSpace());
+ // TODO make .Fn not both a pointer type and a prototype
+ const llvm_addrspace = self.llvmAddressSpace(.generic);
return llvm_fn_ty.pointerType(llvm_addrspace);
},
.ComptimeInt => unreachable,