From 959f04077cda4e2b4a4ffdf01351effe983d5e6e Mon Sep 17 00:00:00 2001 From: Anders Waldenborg Date: Thu, 17 Oct 2013 18:51:01 +0000 Subject: 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 llvm-svn: 192913 --- llvm/lib/Target/Target.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/Target.cpp b/llvm/lib/Target/Target.cpp index 3d92f297be2..2190198d8c9 100644 --- a/llvm/lib/Target/Target.cpp +++ b/llvm/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)); } -- cgit v1.2.3