summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/SymbolTable.cpp
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
commit8f191129239552b876f2c6717fae9619a7701a03 (patch)
tree7ecdf5b84fc94a779ad69fd6f665564d24258f2c /llvm/lib/VMCore/SymbolTable.cpp
parent4b717c0edc082166e85181fa70e76b17669aebe2 (diff)
downloadbcm5719-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/VMCore/SymbolTable.cpp')
-rw-r--r--llvm/lib/VMCore/SymbolTable.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/VMCore/SymbolTable.cpp b/llvm/lib/VMCore/SymbolTable.cpp
index 491d7adc90f..12bf0c7f1ba 100644
--- a/llvm/lib/VMCore/SymbolTable.cpp
+++ b/llvm/lib/VMCore/SymbolTable.cpp
@@ -8,10 +8,6 @@
#include "llvm/InstrTypes.h"
#include "llvm/Support/StringExtras.h"
#include "llvm/DerivedTypes.h"
-#ifndef NDEBUG
-#include "llvm/BasicBlock.h" // Required for assertions to work.
-#include "llvm/Type.h"
-#endif
SymbolTable::~SymbolTable() {
// Drop all abstract type references in the type plane...
@@ -19,16 +15,16 @@ SymbolTable::~SymbolTable() {
if (TyPlane != end()) {
VarMap &TyP = TyPlane->second;
for (VarMap::iterator I = TyP.begin(), E = TyP.end(); I != E; ++I) {
- const Type *Ty = I->second->castTypeAsserting();
+ const Type *Ty = cast<const Type>(I->second);
if (Ty->isAbstract()) // If abstract, drop the reference...
- Ty->castDerivedTypeAsserting()->removeAbstractTypeUser(this);
+ cast<DerivedType>(Ty)->removeAbstractTypeUser(this);
}
}
#ifndef NDEBUG // Only do this in -g mode...
bool LeftoverValues = true;
for (iterator i = begin(); i != end(); ++i) {
for (type_iterator I = i->second.begin(); I != i->second.end(); ++I)
- if (!I->second->isConstant() && !I->second->isType()) {
+ if (!isa<ConstPoolVal>(I->second) && !isa<Type>(I->second)) {
cerr << "Value still in symbol table! Type = '"
<< i->first->getDescription() << "' Name = '" << I->first << "'\n";
LeftoverValues = false;
@@ -112,9 +108,9 @@ Value *SymbolTable::type_remove(const type_iterator &It) {
// If we are removing an abstract type, remove the symbol table from it's use
// list...
if (Ty == Type::TypeTy) {
- const Type *T = Result->castTypeAsserting();
+ const Type *T = cast<const Type>(Result);
if (T->isAbstract())
- T->castDerivedTypeAsserting()->removeAbstractTypeUser(this);
+ cast<DerivedType>(T)->removeAbstractTypeUser(this);
}
return Result;
@@ -149,9 +145,9 @@ void SymbolTable::insertEntry(const string &Name, Value *V) {
// If we are adding an abstract type, add the symbol table to it's use list.
if (VTy == Type::TypeTy) {
- const Type *T = V->castTypeAsserting();
+ const Type *T = cast<const Type>(V);
if (T->isAbstract())
- T->castDerivedTypeAsserting()->addAbstractTypeUser(this);
+ cast<DerivedType>(T)->addAbstractTypeUser(this);
}
}
@@ -174,6 +170,6 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
OldType->removeAbstractTypeUser(this);
I->second = (Value*)NewType; // TODO FIXME when types aren't const
if (NewType->isAbstract())
- NewType->castDerivedTypeAsserting()->addAbstractTypeUser(this);
+ cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
}
}
OpenPOWER on IntegriCloud