mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Add helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f2ec7f59d
commit
f1ab454b71
@ -142,6 +142,14 @@ public:
|
||||
return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
|
||||
}
|
||||
|
||||
/// mustPreserveAnalysisID - This method serves the same function as
|
||||
/// getAnalysisToUpdate, but works if you just have an AnalysisID. This
|
||||
/// obviously cannot give you a properly typed instance of the class if you
|
||||
/// don't have the class name available (use getAnalysisToUpdate if you do),
|
||||
/// but it can tell you if you need to preserve the pass at least.
|
||||
///
|
||||
bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const;
|
||||
|
||||
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
|
||||
/// to the analysis information that they claim to use by overriding the
|
||||
/// getAnalysisUsage function.
|
||||
|
@ -142,6 +142,10 @@ void Pass::addToPassManager(PassManagerT<Module> *PM, AnalysisUsage &AU) {
|
||||
PM->addPass(this, AU);
|
||||
}
|
||||
|
||||
bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
|
||||
return Resolver->getAnalysisToUpdate(AnalysisID) != 0;
|
||||
}
|
||||
|
||||
// dumpPassStructure - Implement the -debug-passes=Structure option
|
||||
void Pass::dumpPassStructure(unsigned Offset) {
|
||||
std::cerr << std::string(Offset*2, ' ') << getPassName() << "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user