summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopAnalysisManager.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-10-04 22:02:27 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-10-04 22:02:27 +0000
commit005b88c0a65c29fc3b4062d4413db0b78d56693e (patch)
tree712f0c5e44b5d14e978050d35f3874765ba7d8b1 /llvm/lib/Analysis/LoopAnalysisManager.cpp
parentd8d97972de792443f6b336ed6d13cf2e5b65151e (diff)
downloadbcm5719-llvm-005b88c0a65c29fc3b4062d4413db0b78d56693e.tar.gz
bcm5719-llvm-005b88c0a65c29fc3b4062d4413db0b78d56693e.zip
Do not call Loop::getName on possibly dead loops
This fixes PR34832. llvm-svn: 314938
Diffstat (limited to 'llvm/lib/Analysis/LoopAnalysisManager.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAnalysisManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoopAnalysisManager.cpp b/llvm/lib/Analysis/LoopAnalysisManager.cpp
index 84a891c3f4f..7647f85019d 100644
--- a/llvm/lib/Analysis/LoopAnalysisManager.cpp
+++ b/llvm/lib/Analysis/LoopAnalysisManager.cpp
@@ -56,8 +56,10 @@ bool LoopAnalysisManagerFunctionProxy::Result::invalidate(
// analysis manager's cache. So we just walk the keys and forcibly clear
// those results. Note that the order doesn't matter here as this will just
// directly destroy the results without calling methods on them.
- for (Loop *L : PreOrderLoops)
- InnerAM->clear(*L, L->getName());
+ for (Loop *L : PreOrderLoops) {
+ // NB! `L` may not be in a good enough state to run Loop::getName.
+ InnerAM->clear(*L, "<possibly invalidated loop>");
+ }
// We also need to null out the inner AM so that when the object gets
// destroyed as invalid we don't try to clear the inner AM again. At that
OpenPOWER on IntegriCloud