aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
committerOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
commitdebcb01b0f0a15f568ca69e8f288fade4bfc7297 (patch)
tree22a274838cf6c55205a8a3f0a80262b09b63b069 /lib/VMCore/Core.cpp
parent37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff)
Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r--lib/VMCore/Core.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index bf5a6a1b75..59aeb87800 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -162,7 +162,7 @@ LLVMTypeRef LLVMInt32Type(void) { return (LLVMTypeRef) Type::Int32Ty; }
LLVMTypeRef LLVMInt64Type(void) { return (LLVMTypeRef) Type::Int64Ty; }
LLVMTypeRef LLVMIntType(unsigned NumBits) {
- return wrap(getGlobalContext().getIntegerType(NumBits));
+ return wrap(IntegerType::get(NumBits));
}
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy) {
@@ -186,8 +186,7 @@ LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I)
Tys.push_back(unwrap(*I));
- return wrap(getGlobalContext().getFunctionType(unwrap(ReturnType), Tys,
- IsVarArg != 0));
+ return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0));
}
int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) {
@@ -218,7 +217,7 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes,
*E = ElementTypes + ElementCount; I != E; ++I)
Tys.push_back(unwrap(*I));
- return wrap(getGlobalContext().getStructType(Tys, Packed != 0));
+ return wrap(StructType::get(Tys, Packed != 0));
}
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy) {
@@ -239,18 +238,15 @@ int LLVMIsPackedStruct(LLVMTypeRef StructTy) {
/*--.. Operations on array, pointer, and vector types (sequence types) .....--*/
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount) {
- return wrap(getGlobalContext().getArrayType(unwrap(ElementType),
- ElementCount));
+ return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
}
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace) {
- return wrap(getGlobalContext().getPointerType(unwrap(ElementType),
- AddressSpace));
+ return wrap(PointerType::get(unwrap(ElementType), AddressSpace));
}
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount) {
- return wrap(getGlobalContext().getVectorType(unwrap(ElementType),
- ElementCount));
+ return wrap(VectorType::get(unwrap(ElementType), ElementCount));
}
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty) {
@@ -275,7 +271,7 @@ LLVMTypeRef LLVMVoidType(void) { return (LLVMTypeRef) Type::VoidTy; }
LLVMTypeRef LLVMLabelType(void) { return (LLVMTypeRef) Type::LabelTy; }
LLVMTypeRef LLVMOpaqueType(void) {
- return wrap(getGlobalContext().getOpaqueType());
+ return wrap(OpaqueType::get());
}
/*--.. Operations on type handles ..........................................--*/
@@ -408,8 +404,7 @@ LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
LLVMValueRef *ConstantVals, unsigned Length) {
- return wrap(ConstantArray::get(
- getGlobalContext().getArrayType(unwrap(ElementTy), Length),
+ return wrap(ConstantArray::get(ArrayType::get(unwrap(ElementTy), Length),
unwrap<Constant>(ConstantVals, Length),
Length));
}