aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/MergeFunctions.cpp
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2015-10-05 17:26:36 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2015-10-05 17:26:36 +0000
commit0591c5d719eccc127dae01ea4f586dc5c6e89478 (patch)
tree84437b030f35509c301067106f01bcb39e8532f8 /llvm/lib/Transforms/IPO/MergeFunctions.cpp
parentd1cf421bd560cac836c064a03032f62bdf49052e (diff)
downloadllvm-0591c5d719eccc127dae01ea4f586dc5c6e89478.zip
llvm-0591c5d719eccc127dae01ea4f586dc5c6e89478.tar.gz
llvm-0591c5d719eccc127dae01ea4f586dc5c6e89478.tar.bz2
MergeFunctions: Clear GlobalNumbers ValueMap
Otherwise, the map will observe changes as long as MergeFunctions is alive. This is bad because follow-up passes could replace-all-uses-with on the key of an entry in the map. The value handle callback of ValueMap however asserts that the key type matches. rdar://22971893 llvm-svn: 249327
Diffstat (limited to 'llvm/lib/Transforms/IPO/MergeFunctions.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 2b0bcdf..d7bfed1 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -164,6 +164,9 @@ class GlobalNumberState {
NextNumber++;
return MapIter->second;
}
+ void clear() {
+ GlobalNumbers.clear();
+ }
};
/// FunctionComparator - Compares two functions to determine whether or not
@@ -1546,6 +1549,7 @@ bool MergeFunctions::runOnModule(Module &M) {
} while (!Deferred.empty());
FnTree.clear();
+ GlobalNumbers.clear();
return Changed;
}