aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-01 18:26:53 +0000
committerChris Lattner <sabre@nondot.org>2001-10-01 18:26:53 +0000
commitcfe26c930ae691ff3012736555846c45087e1a9e (patch)
treeb68b70097da64da9be4a068f62d7ae3d43e05896 /lib/Bytecode/Reader
parent9636a91649f168f41b477cba705287665e054f79 (diff)
Add more support for new style casts
Convert more code to use them git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r--lib/Bytecode/Reader/ConstantReader.cpp5
-rw-r--r--lib/Bytecode/Reader/Reader.cpp4
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index ae206daa37..67cfff7b97 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -149,8 +149,7 @@ bool BytecodeParser::parseTypeConstants(const uchar *&Buf, const uchar *EndBuf,
// abstract type to use the newty. This also will cause the opaque type
// to be deleted...
//
- // FIXME when types are not const
- const_cast<DerivedType*>(Tab[i+BaseLevel]->castDerivedTypeAsserting())->refineAbstractTypeTo(NewTy);
+ cast<DerivedType>(Tab[i+BaseLevel].get())->refineAbstractTypeTo(NewTy);
// This should have replace the old opaque type with the new type in the
// value table...
@@ -159,7 +158,7 @@ bool BytecodeParser::parseTypeConstants(const uchar *&Buf, const uchar *EndBuf,
BCR_TRACE(5, "Resulting types:\n");
for (unsigned i = 0; i < NumEntries; i++) {
- BCR_TRACE(5, Tab[i+BaseLevel]->castTypeAsserting() << "\n");
+ BCR_TRACE(5, cast<Type>(Tab[i+BaseLevel]) << "\n");
}
return false;
}
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index a2038edf34..b7904bb60f 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -55,7 +55,7 @@ const Type *BytecodeParser::getType(unsigned ID) {
const Value *D = getValue(Type::TypeTy, ID, false);
if (D == 0) return failure<const Type*>(0);
- return D->castTypeAsserting();
+ return cast<Type>(D);
}
bool BytecodeParser::insertValue(Value *Val, vector<ValueList> &ValueTab) {
@@ -341,7 +341,7 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
Value *V = getValue(Ty->castPointerType()->getValueType(),
InitSlot, false);
if (V == 0) return failure(true);
- Initializer = V->castConstantAsserting();
+ Initializer = cast<ConstPoolVal>(V);
}
// Create the global variable...