aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-09-20 17:32:52 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-09-20 17:32:52 -0700
commitf8b914fcf328b30f98d31bb6461c953e4b7a33a7 (patch)
tree06b74c36e25e94c1a8a5e384d289ffd556fdd4a9 /src/zig_llvm.cpp
parentabc30f79489b68f6dc0ee4b408c63a8e783215d1 (diff)
parent619260d94d68bdecdac649fa7b156dc8962a9889 (diff)
downloadzig-f8b914fcf328b30f98d31bb6461c953e4b7a33a7.tar.gz
zig-f8b914fcf328b30f98d31bb6461c953e4b7a33a7.zip
Merge branch 'address-space' of Snektron/zig into Snektron-address-space
There were two things to resolve here: * Snektron's branch edited Zir printing, but in master branch I moved the printing code from Zir.zig to print_zir.zig. So that just had to be moved over. * In master branch I fleshed out coerceInMemory a bit more, which caused one of Snektron's test cases to fail, so I had to add addrspace awareness to that. Once I did that the tests passed again.
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index e1ab74f423..6e136161a6 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -416,6 +416,11 @@ ZIG_EXTERN_C LLVMTypeRef ZigLLVMTokenTypeInContext(LLVMContextRef context_ref) {
return wrap(Type::getTokenTy(*unwrap(context_ref)));
}
+LLVMValueRef ZigLLVMAddFunctionInAddressSpace(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy, unsigned AddressSpace) {
+ Function* func = Function::Create(unwrap<FunctionType>(FunctionTy), GlobalValue::ExternalLinkage, AddressSpace, Name, unwrap(M));
+ return wrap(func);
+}
+
LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args,
unsigned NumArgs, ZigLLVM_CallingConv CC, ZigLLVM_CallAttr attr, const char *Name)
{