aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2020-01-15 14:05:56 -0800
committerAlina Sbirlea <asbirlea@google.com>2020-01-17 10:47:51 -0800
commit630a8011e468fb82e546e4aae3ade5984fbfa208 (patch)
tree43d3a4025867dc719f8120c4d925ef6b102189b4 /llvm/lib/Analysis/CallGraph.cpp
parent62a50a95fc644016920eb5c9f21b86619e200a5b (diff)
downloadllvm-630a8011e468fb82e546e4aae3ade5984fbfa208.zip
llvm-630a8011e468fb82e546e4aae3ade5984fbfa208.tar.gz
llvm-630a8011e468fb82e546e4aae3ade5984fbfa208.tar.bz2
[CallGraph] Add invalidate method.
Summary: Add invalidate method in CallGraph. Reviewers: Eugene.Zelenko, chandlerc Subscribers: hiraditya, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72816
Diffstat (limited to 'llvm/lib/Analysis/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/CallGraph.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/CallGraph.cpp b/llvm/lib/Analysis/CallGraph.cpp
index 8e8a5017..99cdf3f 100644
--- a/llvm/lib/Analysis/CallGraph.cpp
+++ b/llvm/lib/Analysis/CallGraph.cpp
@@ -57,6 +57,15 @@ CallGraph::~CallGraph() {
#endif
}
+bool CallGraph::invalidate(Module &, const PreservedAnalyses &PA,
+ ModuleAnalysisManager::Invalidator &) {
+ // 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>());
+}
+
void CallGraph::addToCallGraph(Function *F) {
CallGraphNode *Node = getOrInsertFunction(F);