From 95e83afa98c5af89c6e5f40d559eb54c6c31a54e Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Mon, 6 Sep 2021 00:29:04 +0200 Subject: 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. --- src/codegen/llvm.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/codegen') 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, -- cgit v1.2.3