summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-04 22:26:13 +0000
committerChris Lattner <sabre@nondot.org>2004-08-04 22:26:13 +0000
commitd2da229ce3720f594539113bd3617cb57fd8df66 (patch)
tree55f5d60e50eee21099fb07a2a9a2758bc031edb5 /lib/VMCore
parent4e4f8631f68862cfd725de66422bb867bda0efdf (diff)
downloadllvm-d2da229ce3720f594539113bd3617cb57fd8df66.tar.gz
llvm-d2da229ce3720f594539113bd3617cb57fd8df66.tar.bz2
llvm-d2da229ce3720f594539113bd3617cb57fd8df66.tar.xz
Add a hack to work around a problem my changes exposed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index b65758b7dd..bc274f0e32 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -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?");