summaryrefslogtreecommitdiff
path: root/lib/Bitcode
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/Bitcode
parent37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff)
downloadllvm-debcb01b0f0a15f568ca69e8f288fade4bfc7297.tar.gz
llvm-debcb01b0f0a15f568ca69e8f288fade4bfc7297.tar.bz2
llvm-debcb01b0f0a15f568ca69e8f288fade4bfc7297.tar.xz
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/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 2b22404086..1e6f5b6dd4 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -322,7 +322,7 @@ const Type *BitcodeReader::getTypeByID(unsigned ID, bool isTypeTable) {
// The type table allows forward references. Push as many Opaque types as
// needed to get up to ID.
while (TypeList.size() <= ID)
- TypeList.push_back(Context.getOpaqueType());
+ TypeList.push_back(OpaqueType::get());
return TypeList.back().get();
}
@@ -512,7 +512,7 @@ bool BitcodeReader::ParseTypeTable() {
if (Record.size() < 1)
return Error("Invalid Integer type record");
- ResultTy = Context.getIntegerType(Record[0]);
+ ResultTy = IntegerType::get(Record[0]);
break;
case bitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or
// [pointee type, address space]
@@ -521,7 +521,7 @@ bool BitcodeReader::ParseTypeTable() {
unsigned AddressSpace = 0;
if (Record.size() == 2)
AddressSpace = Record[1];
- ResultTy = Context.getPointerType(getTypeByID(Record[0], true),
+ ResultTy = PointerType::get(getTypeByID(Record[0], true),
AddressSpace);
break;
}
@@ -534,7 +534,7 @@ bool BitcodeReader::ParseTypeTable() {
for (unsigned i = 3, e = Record.size(); i != e; ++i)
ArgTys.push_back(getTypeByID(Record[i], true));
- ResultTy = Context.getFunctionType(getTypeByID(Record[2], true), ArgTys,
+ ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys,
Record[0]);
break;
}
@@ -544,24 +544,24 @@ bool BitcodeReader::ParseTypeTable() {
std::vector<const Type*> EltTys;
for (unsigned i = 1, e = Record.size(); i != e; ++i)
EltTys.push_back(getTypeByID(Record[i], true));
- ResultTy = Context.getStructType(EltTys, Record[0]);
+ ResultTy = StructType::get(EltTys, Record[0]);
break;
}
case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
if (Record.size() < 2)
return Error("Invalid ARRAY type record");
- ResultTy = Context.getArrayType(getTypeByID(Record[1], true), Record[0]);
+ ResultTy = ArrayType::get(getTypeByID(Record[1], true), Record[0]);
break;
case bitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
if (Record.size() < 2)
return Error("Invalid VECTOR type record");
- ResultTy = Context.getVectorType(getTypeByID(Record[1], true), Record[0]);
+ ResultTy = VectorType::get(getTypeByID(Record[1], true), Record[0]);
break;
}
if (NumRecords == TypeList.size()) {
// If this is a new type slot, just append it.
- TypeList.push_back(ResultTy ? ResultTy : Context.getOpaqueType());
+ TypeList.push_back(ResultTy ? ResultTy : OpaqueType::get());
++NumRecords;
} else if (ResultTy == 0) {
// Otherwise, this was forward referenced, so an opaque type was created,
@@ -1046,7 +1046,7 @@ bool BitcodeReader::ParseConstants() {
return Error("Invalid CE_SHUFFLEVEC record");
Constant *Op0 = ValueList.getConstantFwdRef(Record[0], OpTy);
Constant *Op1 = ValueList.getConstantFwdRef(Record[1], OpTy);
- const Type *ShufTy = Context.getVectorType(Type::Int32Ty,
+ const Type *ShufTy = VectorType::get(Type::Int32Ty,
OpTy->getNumElements());
Constant *Op2 = ValueList.getConstantFwdRef(Record[2], ShufTy);
V = ConstantExpr::getShuffleVector(Op0, Op1, Op2);
@@ -1059,7 +1059,7 @@ bool BitcodeReader::ParseConstants() {
return Error("Invalid CE_SHUFVEC_EX record");
Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
Constant *Op1 = ValueList.getConstantFwdRef(Record[2], OpTy);
- const Type *ShufTy = Context.getVectorType(Type::Int32Ty,
+ const Type *ShufTy = VectorType::get(Type::Int32Ty,
RTy->getNumElements());
Constant *Op2 = ValueList.getConstantFwdRef(Record[3], ShufTy);
V = ConstantExpr::getShuffleVector(Op0, Op1, Op2);
@@ -1940,7 +1940,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
Value *Val, *Ptr;
if (getValueTypePair(Record, OpNum, NextValueNo, Val) ||
getValue(Record, OpNum,
- Context.getPointerTypeUnqual(Val->getType()), Ptr)||
+ PointerType::getUnqual(Val->getType()), Ptr)||
OpNum+2 != Record.size())
return Error("Invalid STORE record");