diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-01 18:26:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-01 18:26:53 +0000 |
commit | 8f191129239552b876f2c6717fae9619a7701a03 (patch) | |
tree | 7ecdf5b84fc94a779ad69fd6f665564d24258f2c /llvm/lib/Bytecode | |
parent | 4b717c0edc082166e85181fa70e76b17669aebe2 (diff) | |
download | bcm5719-llvm-8f191129239552b876f2c6717fae9619a7701a03.tar.gz bcm5719-llvm-8f191129239552b876f2c6717fae9619a7701a03.zip |
Add more support for new style casts
Convert more code to use them
llvm-svn: 695
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r-- | llvm/lib/Bytecode/Reader/ConstantReader.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Bytecode/Reader/Reader.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp index ae206daa370..67cfff7b973 100644 --- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp +++ b/llvm/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/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index a2038edf342..b7904bb60f7 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/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... diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 04a0ca4624f..94cbcec328d 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -84,7 +84,8 @@ void BytecodeWriter::outputConstants(bool isMethod) { unsigned NC = ValNo; // Number of constants for (; NC < Plane.size() && - (Plane[NC]->isConstant() || Plane[NC]->isType()); NC++) /*empty*/; + (isa<ConstPoolVal>(Plane[NC]) || + isa<Type>(Plane[NC])); NC++) /*empty*/; NC -= ValNo; // Convert from index into count if (NC == 0) continue; // Skip empty type planes... |