diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-01-25 03:56:34 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-01-25 03:56:34 +0000 |
| commit | 36faf3a99cb1688c6abac3ec9f28c6eb3dd65af0 (patch) | |
| tree | 13921cd60283a0175aa0e3fa0f72980caedf8a3f /llvm/lib | |
| parent | 67e5c29ae4b11d4566eedae6bcbbe840cecc0e67 (diff) | |
| download | bcm5719-llvm-36faf3a99cb1688c6abac3ec9f28c6eb3dd65af0.tar.gz bcm5719-llvm-36faf3a99cb1688c6abac3ec9f28c6eb3dd65af0.zip | |
This checkin fixes the bug described in:
test/Regression/Assembler/2002-01-24-BadSymbolTableAssert.ll
llvm-svn: 1583
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/SymbolTable.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/llvm/lib/VMCore/SymbolTable.cpp b/llvm/lib/VMCore/SymbolTable.cpp index ab98a731841..ab15eb6eec6 100644 --- a/llvm/lib/VMCore/SymbolTable.cpp +++ b/llvm/lib/VMCore/SymbolTable.cpp @@ -208,8 +208,8 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType, #if DEBUG_ABSTYPE cerr << "[Added] refined to abstype: "<<NewType->getDescription()<<endl; #endif + } } - } VarMap &NewPlane = NewTypeIt->second; VarMap &OldPlane = TPI->second; @@ -283,29 +283,29 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType, } TPI = find(Type::TypeTy); - assert(TPI != end() &&"Type plane not in symbol table but we contain types!"); - - // Loop over all of the types in the symbol table, replacing any references to - // OldType with references to NewType. Note that there may be multiple - // occurances, and although we only need to remove one at a time, it's faster - // to remove them all in one pass. - // - VarMap &TyPlane = TPI->second; - for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I) - if (I->second == (Value*)OldType) { // FIXME when Types aren't const. + if (TPI != end()) { + // Loop over all of the types in the symbol table, replacing any references to + // OldType with references to NewType. Note that there may be multiple + // occurances, and although we only need to remove one at a time, it's faster + // to remove them all in one pass. + // + VarMap &TyPlane = TPI->second; + for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I) + if (I->second == (Value*)OldType) { // FIXME when Types aren't const. #if DEBUG_ABSTYPE - cerr << "Removing type " << OldType->getDescription() << endl; + cerr << "Removing type " << OldType->getDescription() << endl; #endif - OldType->removeAbstractTypeUser(this); - - I->second = (Value*)NewType; // TODO FIXME when types aren't const - if (NewType->isAbstract()) { + OldType->removeAbstractTypeUser(this); + + I->second = (Value*)NewType; // TODO FIXME when types aren't const + if (NewType->isAbstract()) { #if DEBUG_ABSTYPE - cerr << "Added type " << NewType->getDescription() << endl; + cerr << "Added type " << NewType->getDescription() << endl; #endif - cast<const DerivedType>(NewType)->addAbstractTypeUser(this); + cast<const DerivedType>(NewType)->addAbstractTypeUser(this); + } } - } + } } |

