From 005b88c0a65c29fc3b4062d4413db0b78d56693e Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Wed, 4 Oct 2017 22:02:27 +0000 Subject: Do not call Loop::getName on possibly dead loops This fixes PR34832. llvm-svn: 314938 --- llvm/lib/Analysis/LoopAnalysisManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/LoopAnalysisManager.cpp') 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, ""); + } // 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 -- cgit v1.2.3