aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Target.cpp')
-rw-r--r--llvm/lib/Target/Target.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/Target.cpp b/llvm/lib/Target/Target.cpp
index c2b4393..5d1616d 100644
--- a/llvm/lib/Target/Target.cpp
+++ b/llvm/lib/Target/Target.cpp
@@ -24,6 +24,9 @@
using namespace llvm;
+// Avoid including "llvm-c/Core.h" for compile time, fwd-declare this instead.
+extern "C" LLVMContextRef LLVMGetGlobalContext(void);
+
inline TargetLibraryInfoImpl *unwrap(LLVMTargetLibraryInfoRef P) {
return reinterpret_cast<TargetLibraryInfoImpl*>(P);
}
@@ -81,11 +84,11 @@ unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS) {
}
LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD) {
- return wrap(unwrap(TD)->getIntPtrType(getGlobalContext()));
+ return wrap(unwrap(TD)->getIntPtrType(*unwrap(LLVMGetGlobalContext())));
}
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS) {
- return wrap(unwrap(TD)->getIntPtrType(getGlobalContext(), AS));
+ return wrap(unwrap(TD)->getIntPtrType(*unwrap(LLVMGetGlobalContext()), AS));
}
LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD) {