Add a hack to work around a problem my changes exposed

llvm-svn: 15509
This commit is contained in:
Chris Lattner 2004-08-04 22:26:13 +00:00
parent 8e5492e350
commit 20a4dab308
1 changed files with 7 additions and 0 deletions

View File

@ -608,6 +608,13 @@ namespace {
void remove(ConstantClass *CP) {
MapIterator I = Map.find(MapKey((TypeClass*)CP->getRawType(),
getValType(CP)));
if (I == Map.end() || I->second != CP) {
// FIXME: This should not use a linear scan. If this gets to be a
// performance problem, someone should look at this.
for (I = Map.begin(); I != Map.end() && I->second != CP; ++I)
/* empty */;
}
assert(I != Map.end() && "Constant not found in constant table!");
assert(I->second == CP && "Didn't find correct element?");