LLVM  3.7.0
CGSCCPassManager.cpp
Go to the documentation of this file.
1 //===- CGSCCPassManager.cpp - Managing & running CGSCC passes -------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
12 #include "llvm/Support/Debug.h"
13 
14 using namespace llvm;
15 
16 char CGSCCAnalysisManagerModuleProxy::PassID;
17 
20  assert(CGAM->empty() && "CGSCC analyses ran prior to the module proxy!");
21  return Result(*CGAM);
22 }
23 
25  // Clear out the analysis manager if we're being destroyed -- it means we
26  // didn't even see an invalidate call when we got invalidated.
27  CGAM->clear();
28 }
29 
31  Module &M, const PreservedAnalyses &PA) {
32  // If this proxy isn't marked as preserved, then we can't even invalidate
33  // individual CGSCC analyses, there may be an invalid set of SCC objects in
34  // the cache making it impossible to incrementally preserve them.
35  // Just clear the entire manager.
36  if (!PA.preserved(ID()))
37  CGAM->clear();
38 
39  // Return false to indicate that this result is still a valid proxy.
40  return false;
41 }
42 
43 char ModuleAnalysisManagerCGSCCProxy::PassID;
44 
45 char FunctionAnalysisManagerCGSCCProxy::PassID;
46 
49  assert(FAM->empty() && "Function analyses ran prior to the CGSCC proxy!");
50  return Result(*FAM);
51 }
52 
54  // Clear out the analysis manager if we're being destroyed -- it means we
55  // didn't even see an invalidate call when we got invalidated.
56  FAM->clear();
57 }
58 
61  // If this proxy isn't marked as preserved, then we can't even invalidate
62  // individual function analyses, there may be an invalid set of Function
63  // objects in the cache making it impossible to incrementally preserve them.
64  // Just clear the entire manager.
65  if (!PA.preserved(ID()))
66  FAM->clear();
67 
68  // Return false to indicate that this result is still a valid proxy.
69  return false;
70 }
71 
72 char CGSCCAnalysisManagerFunctionProxy::PassID;
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:114
bool invalidate(Module &M, const PreservedAnalyses &PA)
Handler for invalidation of the module.
Result run(Module &M)
Run the analysis pass and create our proxy result object.
Result run(LazyCallGraph::SCC &C)
Run the analysis pass and create our proxy result object.
bool empty() const
Returns true if the analysis manager has an empty results cache.
Definition: PassManager.h:438
An abstract set of preserved analyses following a transformation pass run.
Definition: PassManager.h:69
bool invalidate(LazyCallGraph::SCC &C, const PreservedAnalyses &PA)
Handler for invalidation of the SCC.
void clear()
Clear the analysis result cache.
Definition: PassManager.h:451
This header provides classes for managing passes over SCCs of the call graph.
bool preserved() const
Query whether a pass is marked as preserved by this set.
Definition: PassManager.h:139
An SCC of the call graph.