[llvm] 6dd17a2 - [CallGraph] Don't preserve CallGraph when function CFG analyses are preserved
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 19 13:01:36 PDT 2022
Author: Arthur Eubanks
Date: 2022-06-19T13:01:08-07:00
New Revision: 6dd17a2b3403adeef74217e2f23f00fe656d38d1
URL: https://github.com/llvm/llvm-project/commit/6dd17a2b3403adeef74217e2f23f00fe656d38d1
DIFF: https://github.com/llvm/llvm-project/commit/6dd17a2b3403adeef74217e2f23f00fe656d38d1.diff
LOG: [CallGraph] Don't preserve CallGraph when function CFG analyses are preserved
The call graph has nothing to with function CFGs.
Fixes a crash in a future change that exposes this bug.
Added:
Modified:
llvm/lib/Analysis/CallGraph.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/CallGraph.cpp b/llvm/lib/Analysis/CallGraph.cpp
index 1a73dad23f83..f85527122b2a 100644
--- a/llvm/lib/Analysis/CallGraph.cpp
+++ b/llvm/lib/Analysis/CallGraph.cpp
@@ -69,8 +69,7 @@ bool CallGraph::invalidate(Module &, const PreservedAnalyses &PA,
// Check whether the analysis, all analyses on functions, or the function's
// CFG have been preserved.
auto PAC = PA.getChecker<CallGraphAnalysis>();
- return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>() ||
- PAC.preservedSet<CFGAnalyses>());
+ return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>());
}
void CallGraph::addToCallGraph(Function *F) {
More information about the llvm-commits
mailing list