19 #ifndef LLVM_PASSANALYSISSUPPORT_H
20 #define LLVM_PASSANALYSISSUPPORT_H
59 template<
class PassClass>
65 template<
class PassClass>
82 template<
class PassClass>
101 template<
class PassClass>
132 return RequiredTransitive;
155 Pass *ResultPass =
nullptr;
156 for (
const auto &AnalysisImpl : AnalysisImpls) {
157 if (AnalysisImpl.first == PI) {
158 ResultPass = AnalysisImpl.second;
171 std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
172 AnalysisImpls.push_back(pir);
177 AnalysisImpls.clear();
186 std::vector<std::pair<AnalysisID, Pass*> > AnalysisImpls;
200 template<
typename AnalysisType>
202 assert(Resolver &&
"Pass not resident in a PassManager object!");
207 if (!ResultPass)
return nullptr;
220 template<
typename AnalysisType>
222 assert(Resolver &&
"Pass has not been inserted into a PassManager object!");
226 template<
typename AnalysisType>
228 assert(PI &&
"getAnalysis for unregistered pass!");
229 assert(Resolver&&
"Pass has not been inserted into a PassManager object!");
235 "getAnalysis*() called on an analysis that was not "
236 "'required' by pass!");
249 template<
typename AnalysisType>
251 assert(Resolver &&
"Pass has not been inserted into a PassManager object!");
256 template<
typename AnalysisType>
258 assert(PI &&
"getAnalysis for unregistered pass!");
259 assert(Resolver &&
"Pass has not been inserted into a PassManager object!");
264 assert(ResultPass &&
"Unable to find requested analysis info");
Pass interface - Implemented by all 'passes'.
void push_back(const T &Elt)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
AnalysisType & getAnalysisID(AnalysisID PI) const
const VectorType & getPreservedSet() const
AnalysisUsage & addRequired()
AnalysisType * getAnalysisIfAvailable() const
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information tha...
SmallVectorImpl< AnalysisID > VectorType
AnalysisUsage & addPreservedID(char &ID)
AnalysisUsage & addUsedIfAvailableID(char &ID)
Pass * getAnalysisIfAvailable(AnalysisID ID, bool Direction) const
Return analysis result or null if it doesn't exist.
Function Alias Analysis false
AnalysisUsage & addPreservedID(const void *ID)
AnalysisResolver(PMDataManager &P)
const VectorType & getRequiredTransitiveSet() const
Represent the analysis usage information of a pass.
const VectorType & getUsedSet() const
AnalysisUsage & addUsedIfAvailableID(const void *ID)
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
AnalysisUsage & addRequiredID(const void *ID)
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
void addAnalysisImplsPair(AnalysisID PI, Pass *P)
void setPreservesCFG()
This function should be called by the pass, iff they do not:
void clearAnalysisImpls()
Clear cache that is used to connect a pass to the the analysis (PassInfo).
Pass * findImplPass(AnalysisID PI)
Find pass that is implementing PI.
void setPreservesAll()
Set by analyses that do not transform their input at all.
const VectorType & getRequiredSet() const
PMDataManager & getPMDataManager()
AnalysisUsage & addRequiredTransitiveID(char &ID)
AnalysisUsage & addRequiredTransitive()
PMDataManager provides the common place to manage the analysis data used by pass managers.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
StringRef - Represent a constant reference to a string, i.e.