mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +00:00
This checkin fixes the bug described in:
test/Regression/Assembler/2002-01-24-BadSymbolTableAssert.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02d429d1db
commit
d71cc4b518
@ -208,8 +208,8 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
|
|||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
cerr << "[Added] refined to abstype: "<<NewType->getDescription()<<endl;
|
cerr << "[Added] refined to abstype: "<<NewType->getDescription()<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
VarMap &NewPlane = NewTypeIt->second;
|
VarMap &NewPlane = NewTypeIt->second;
|
||||||
VarMap &OldPlane = TPI->second;
|
VarMap &OldPlane = TPI->second;
|
||||||
@ -283,29 +283,29 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TPI = find(Type::TypeTy);
|
TPI = find(Type::TypeTy);
|
||||||
assert(TPI != end() &&"Type plane not in symbol table but we contain types!");
|
if (TPI != end()) {
|
||||||
|
// Loop over all of the types in the symbol table, replacing any references to
|
||||||
// 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
|
||||||
// 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
|
||||||
// occurances, and although we only need to remove one at a time, it's faster
|
// to remove them all in one pass.
|
||||||
// to remove them all in one pass.
|
//
|
||||||
//
|
VarMap &TyPlane = TPI->second;
|
||||||
VarMap &TyPlane = TPI->second;
|
for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I)
|
||||||
for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I)
|
if (I->second == (Value*)OldType) { // FIXME when Types aren't const.
|
||||||
if (I->second == (Value*)OldType) { // FIXME when Types aren't const.
|
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
cerr << "Removing type " << OldType->getDescription() << endl;
|
cerr << "Removing type " << OldType->getDescription() << endl;
|
||||||
#endif
|
#endif
|
||||||
OldType->removeAbstractTypeUser(this);
|
OldType->removeAbstractTypeUser(this);
|
||||||
|
|
||||||
I->second = (Value*)NewType; // TODO FIXME when types aren't const
|
I->second = (Value*)NewType; // TODO FIXME when types aren't const
|
||||||
if (NewType->isAbstract()) {
|
if (NewType->isAbstract()) {
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
cerr << "Added type " << NewType->getDescription() << endl;
|
cerr << "Added type " << NewType->getDescription() << endl;
|
||||||
#endif
|
#endif
|
||||||
cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
|
cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user