diff options
author | Anders Waldenborg <anders@0x63.nu> | 2013-10-17 18:51:01 +0000 |
---|---|---|
committer | Anders Waldenborg <anders@0x63.nu> | 2013-10-17 18:51:01 +0000 |
commit | f4094e5ed7387b29eda8d9a7865f6b5dfd47ce82 (patch) | |
tree | 3ab6f70e35a6f95a932590488beb556de5666a7b /lib/Target | |
parent | 4d1a9256752048f34c6091cc145fce9f89d20985 (diff) | |
download | external_llvm-f4094e5ed7387b29eda8d9a7865f6b5dfd47ce82.zip external_llvm-f4094e5ed7387b29eda8d9a7865f6b5dfd47ce82.tar.gz external_llvm-f4094e5ed7387b29eda8d9a7865f6b5dfd47ce82.tar.bz2 |
llvm-c: Add LLVMIntPtrType{,ForAS}InContext
All of the Core API functions have versions which accept explicit context, in
addition to ones which work on global context. This commit adds functions
which accept explicit context to the Target API for consistency.
Patch by Peter Zotov
Differential Revision: http://llvm-reviews.chandlerc.com/D1912
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/Target.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp index 3d92f29..2190198 100644 --- a/lib/Target/Target.cpp +++ b/lib/Target/Target.cpp @@ -88,6 +88,14 @@ LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS) { return wrap(unwrap(TD)->getIntPtrType(getGlobalContext(), AS)); } +LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD) { + return wrap(unwrap(TD)->getIntPtrType(*unwrap(C))); +} + +LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, unsigned AS) { + return wrap(unwrap(TD)->getIntPtrType(*unwrap(C), AS)); +} + unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty) { return unwrap(TD)->getTypeSizeInBits(unwrap(Ty)); } |