diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-17 16:08:32 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-17 16:08:32 +0000 |
commit | 57cebeec7ba08b55f29f5bf98ad0a3a17e9d0c71 (patch) | |
tree | 7c0fd6ef432b8676a5cf19c374b330842c4e5456 /lib/VMCore/Core.cpp | |
parent | 4374f8e208806ae4ffaa57a4b69eba5571207ba1 (diff) | |
download | external_llvm-57cebeec7ba08b55f29f5bf98ad0a3a17e9d0c71.zip external_llvm-57cebeec7ba08b55f29f5bf98ad0a3a17e9d0c71.tar.gz external_llvm-57cebeec7ba08b55f29f5bf98ad0a3a17e9d0c71.tar.bz2 |
C and Ocaml bindings for address spaces, for that burgeoning market
for Ocaml-based compilers targeting embedded devices. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r-- | lib/VMCore/Core.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 9a7c790..4c56e55 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -145,16 +145,15 @@ int LLVMIsPackedStruct(LLVMTypeRef StructTy) { /*--.. Operations on array, pointer, and vector types (sequence types) .....--*/ -LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount){ +LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount) { return wrap(ArrayType::get(unwrap(ElementType), ElementCount)); } -LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType) { - // FIXME: Needst to handle address spaces - return wrap(PointerType::getUnqual(unwrap(ElementType))); +LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace) { + return wrap(PointerType::get(unwrap(ElementType), AddressSpace)); } -LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType,unsigned ElementCount){ +LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount) { return wrap(VectorType::get(unwrap(ElementType), ElementCount)); } @@ -166,6 +165,10 @@ unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy) { return unwrap<ArrayType>(ArrayTy)->getNumElements(); } +unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy) { + return unwrap<PointerType>(PointerTy)->getAddressSpace(); +} + unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy) { return unwrap<VectorType>(VectorTy)->getNumElements(); } |