diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-17 23:57:36 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-17 23:57:36 +0000 |
commit | ffe77d36eb50f5236cb31e2f5b51e00d475e29f9 (patch) | |
tree | 49bf40c319c4b0c8b85eb5415233b40b2609b4fe /lib/VMCore | |
parent | 0f7eea5d0401a3aaff27d2fdb34044e5983db3d1 (diff) | |
download | external_llvm-ffe77d36eb50f5236cb31e2f5b51e00d475e29f9.zip external_llvm-ffe77d36eb50f5236cb31e2f5b51e00d475e29f9.tar.gz external_llvm-ffe77d36eb50f5236cb31e2f5b51e00d475e29f9.tar.bz2 |
bug 122:
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/SymbolTable.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp index d95fc8f..d0ed246 100644 --- a/lib/VMCore/SymbolTable.cpp +++ b/lib/VMCore/SymbolTable.cpp @@ -39,10 +39,10 @@ SymbolTable::~SymbolTable() { for (plane_iterator PI = pmap.begin(); PI != pmap.end(); ++PI) { for (value_iterator VI = PI->second.begin(); VI != PI->second.end(); ++VI) if (!isa<Constant>(VI->second) ) { - std::cerr << "Value still in symbol table! Type = '" + std::cerr << "Value still in symbol table! Type = '" << PI->first->getDescription() << "' Name = '" << VI->first << "'\n"; - LeftoverValues = false; + LeftoverValues = false; } } @@ -300,15 +300,13 @@ bool SymbolTable::strip( void ) { value_iterator B = Plane.begin(), Bend = Plane.end(); while (B != Bend) { // Found nonempty type plane! Value *V = B->second; - if (isa<Constant>(V)) { - remove(V); + if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()){ + // Set name to "", removing from symbol table! + V->setName("", this); + RemovedSymbol = true; + } else if (isa<Constant>(V) ) { + remove(V); RemovedSymbol = true; - } else { - if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()){ - // Set name to "", removing from symbol table! - V->setName("", this); - RemovedSymbol = true; - } } ++B; } @@ -326,7 +324,7 @@ bool SymbolTable::strip( void ) { // This function is called when one of the types in the type plane are refined void SymbolTable::refineAbstractType(const DerivedType *OldType, - const Type *NewType) { + const Type *NewType) { // Search to see if we have any values of the type Oldtype. If so, we need to // move them into the newtype plane... @@ -441,9 +439,9 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType, I->second = (Type*)NewType; // TODO FIXME when types aren't const if (NewType->isAbstract()) { #if DEBUG_ABSTYPE - std::cerr << "Added type " << NewType->getDescription() << "\n"; + std::cerr << "Added type " << NewType->getDescription() << "\n"; #endif - cast<DerivedType>(NewType)->addAbstractTypeUser(this); + cast<DerivedType>(NewType)->addAbstractTypeUser(this); } } } |