aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2016-08-08 05:38:01 +0000
committerSean Silva <chisophugis@gmail.com>2016-08-08 05:38:01 +0000
commit744f7a843f163a3fa1833102b1d9164e5af8dbd5 (patch)
tree73263be18b753e95382eabb0239c6df187b31ad7 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parent571906247e077da5c02d9bc388f947299e5fdffb (diff)
downloadllvm-744f7a843f163a3fa1833102b1d9164e5af8dbd5.zip
llvm-744f7a843f163a3fa1833102b1d9164e5af8dbd5.tar.gz
llvm-744f7a843f163a3fa1833102b1d9164e5af8dbd5.tar.bz2
[PM] Invalidate CallGraphAnalysis because it holds AssertingVH
This is essentially PR28400. The fix here is similar to that implemented in r274656. llvm-svn: 277980
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index a68e8d8..e4b86e9 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -1271,6 +1271,11 @@ ReversePostOrderFunctionAttrsPass::run(Module &M, AnalysisManager<Module> &AM) {
auto &CG = AM.getResult<CallGraphAnalysis>(M);
bool Changed = deduceFunctionAttributeInRPO(M, CG);
+
+ // CallGraphAnalysis holds AssertingVH and must be invalidated eagerly so
+ // that other passes don't delete stuff from under it.
+ AM.invalidate<CallGraphAnalysis>(M);
+
if (!Changed)
return PreservedAnalyses::all();
PreservedAnalyses PA;