aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/LLVMContext.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-30 17:50:28 +0000
committerOwen Anderson <resistor@mac.com>2009-06-30 17:50:28 +0000
commit72bf4473a6ca3809dd1f97a15b00f70b56358213 (patch)
treea04bada03b42a39d85dbc864ad456a1b85b49fcc /lib/VMCore/LLVMContext.cpp
parent2c6f9f7227897e0487917f454200a9d167bcda2f (diff)
Add wrappers for type construction to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContext.cpp')
-rw-r--r--lib/VMCore/LLVMContext.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index c2aa4324c4..e0fe6ab792 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -14,6 +14,7 @@
#include "llvm/LLVMContext.h"
#include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
#include "LLVMContextImpl.h"
using namespace llvm;
@@ -382,3 +383,60 @@ Constant* LLVMContext::getConstantVector(Constant* const* Vals,
ConstantVector* LLVMContext::getConstantVectorAllOnes(const VectorType* Ty) {
return ConstantVector::getAllOnesValue(Ty);
}
+
+// FunctionType accessors
+FunctionType* LLVMContext::getFunctionType(const Type* Result,
+ const std::vector<const Type*>& Params,
+ bool isVarArg) {
+ return FunctionType::get(Result, Params, isVarArg);
+}
+
+// IntegerType accessors
+const IntegerType* LLVMContext::getIntegerType(unsigned NumBits) {
+ return IntegerType::get(NumBits);
+}
+
+// OpaqueType accessors
+OpaqueType* LLVMContext::getOpaqueType() {
+ return OpaqueType::get();
+}
+
+// StructType accessors
+StructType* LLVMContext::getStructType(const std::vector<const Type*>& Params,
+ bool isPacked) {
+ return StructType::get(Params, isPacked);
+}
+
+// ArrayType accessors
+ArrayType* LLVMContext::getArrayType(const Type* ElementType,
+ uint64_t NumElements) {
+ return ArrayType::get(ElementType, NumElements);
+}
+
+// PointerType accessors
+PointerType* LLVMContext::getPointerType(const Type* ElementType,
+ unsigned AddressSpace) {
+ return PointerType::get(ElementType, AddressSpace);
+}
+
+PointerType* LLVMContext::getPointerTypeUnqualified(const Type* ElementType) {
+ return PointerType::getUnqual(ElementType);
+}
+
+// VectorType accessors
+VectorType* LLVMContext::getVectorType(const Type* ElementType,
+ unsigned NumElements) {
+ return VectorType::get(ElementType, NumElements);
+}
+
+VectorType* LLVMContext::getVectorTypeInteger(const VectorType* VTy) {
+ return VectorType::getInteger(VTy);
+}
+
+VectorType* LLVMContext::getVectorTypeExtendedElement(const VectorType* VTy) {
+ return VectorType::getExtendedElementVectorType(VTy);
+}
+
+VectorType* LLVMContext::getVectorTypeTruncatedElement(const VectorType* VTy) {
+ return VectorType::getTruncatedElementVectorType(VTy);
+}