Skip to content

Commit 6dd17a2

Browse files
committed
[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.
1 parent 4022551 commit 6dd17a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Analysis/CallGraph.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ bool CallGraph::invalidate(Module &, const PreservedAnalyses &PA,
6969
// Check whether the analysis, all analyses on functions, or the function's
7070
// CFG have been preserved.
7171
auto PAC = PA.getChecker<CallGraphAnalysis>();
72-
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>() ||
73-
PAC.preservedSet<CFGAnalyses>());
72+
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>());
7473
}
7574

7675
void CallGraph::addToCallGraph(Function *F) {

0 commit comments

Comments
 (0)