- Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to

setPreservesCFG to be less confusing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-10-21 20:00:28 +00:00
parent 8291e0465b
commit cb2610ea03
15 changed files with 28 additions and 27 deletions

View File

@ -61,17 +61,18 @@ public:
// setPreservesAll - Set by analyses that do not transform their input at all // setPreservesAll - Set by analyses that do not transform their input at all
void setPreservesAll() { PreservesAll = true; } void setPreservesAll() { PreservesAll = true; }
bool preservesAll() const { return PreservesAll; } bool getPreservesAll() const { return PreservesAll; }
// preservesCFG - This function should be called by the pass, iff they do not: /// setPreservesCFG - This function should be called by the pass, iff they do
// /// not:
// 1. Add or remove basic blocks from the function ///
// 2. Modify terminator instructions in any way. /// 1. Add or remove basic blocks from the function
// /// 2. Modify terminator instructions in any way.
// This function annotates the AnalysisUsage info object to say that analyses ///
// that only depend on the CFG are preserved by this pass. /// This function annotates the AnalysisUsage info object to say that analyses
// /// that only depend on the CFG are preserved by this pass.
void preservesCFG(); ///
void setPreservesCFG();
const std::vector<AnalysisID> &getRequiredSet() const { return Required; } const std::vector<AnalysisID> &getRequiredSet() const { return Required; }
const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; } const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; }

View File

@ -78,7 +78,7 @@ namespace {
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };

View File

@ -569,7 +569,7 @@ namespace {
virtual bool runOnFunction(Function &F) { return doRPR(F); } virtual bool runOnFunction(Function &F) { return doRPR(F); }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };
} }

View File

@ -27,7 +27,7 @@ namespace {
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };

View File

@ -38,7 +38,7 @@ namespace {
} }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };
@ -60,7 +60,7 @@ namespace {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };

View File

@ -39,7 +39,7 @@ namespace {
// This transformation requires dominator and immediate dominator info // This transformation requires dominator and immediate dominator info
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
AU.addRequired<DominatorSet>(); AU.addRequired<DominatorSet>();
AU.addRequired<ImmediateDominators>(); AU.addRequired<ImmediateDominators>();
AU.addRequired<ValueNumbering>(); AU.addRequired<ValueNumbering>();

View File

@ -190,7 +190,7 @@ namespace {
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfo>(); AU.addRequired<LoopInfo>();
AU.preservesCFG(); AU.setPreservesCFG();
} }
}; };
RegisterOpt<InductionVariableSimplify> X("indvars", RegisterOpt<InductionVariableSimplify> X("indvars",

View File

@ -53,7 +53,7 @@ namespace {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
// Visitation implementation - Implement instruction combining for different // Visitation implementation - Implement instruction combining for different

View File

@ -29,7 +29,7 @@ namespace {
/// loop preheaders be inserted into the CFG... /// loop preheaders be inserted into the CFG...
/// ///
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
AU.addRequiredID(LoopPreheadersID); AU.addRequiredID(LoopPreheadersID);
AU.addRequired<LoopInfo>(); AU.addRequired<LoopInfo>();
AU.addRequired<DominatorTree>(); AU.addRequired<DominatorTree>();

View File

@ -42,7 +42,7 @@ namespace {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
AU.addRequired<DominatorSet>(); AU.addRequired<DominatorSet>();
} }

View File

@ -37,7 +37,7 @@ namespace {
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }
private: private:
void BuildRankMap(Function &F); void BuildRankMap(Function &F);

View File

@ -96,7 +96,7 @@ public:
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG(); AU.setPreservesCFG();
} }

View File

@ -55,7 +55,7 @@ namespace {
// //
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DominanceFrontier>(); AU.addRequired<DominanceFrontier>();
AU.preservesCFG(); AU.setPreservesCFG();
} }
private: private:

View File

@ -43,7 +43,7 @@ void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) {
// AnalysisUsage Class Implementation // AnalysisUsage Class Implementation
// //
// preservesCFG - This function should be called to by the pass, iff they do // setPreservesCFG - This function should be called to by the pass, iff they do
// not: // not:
// //
// 1. Add or remove basic blocks from the function // 1. Add or remove basic blocks from the function
@ -52,7 +52,7 @@ void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) {
// This function annotates the AnalysisUsage info object to say that analyses // This function annotates the AnalysisUsage info object to say that analyses
// that only depend on the CFG are preserved by this pass. // that only depend on the CFG are preserved by this pass.
// //
void AnalysisUsage::preservesCFG() { void AnalysisUsage::setPreservesCFG() {
// Since this transformation doesn't modify the CFG, it preserves all analyses // Since this transformation doesn't modify the CFG, it preserves all analyses
// that only depend on the CFG (like dominators, loop info, etc...) // that only depend on the CFG (like dominators, loop info, etc...)
// //

View File

@ -252,7 +252,7 @@ public:
// Erase all analyses not in the preserved set... // Erase all analyses not in the preserved set...
if (!AnUsage.preservesAll()) { if (!AnUsage.getPreservesAll()) {
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet(); const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(), for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(),
E = CurrentAnalyses.end(); I != E; ) E = CurrentAnalyses.end(); I != E; )
@ -472,7 +472,7 @@ private:
markPassUsed(*I, P); // Mark *I as used by P markPassUsed(*I, P); // Mark *I as used by P
// Erase all analyses not in the preserved set... // Erase all analyses not in the preserved set...
if (!AnUsage.preservesAll()) { if (!AnUsage.getPreservesAll()) {
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet(); const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(), for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(),
E = CurrentAnalyses.end(); I != E; ) { E = CurrentAnalyses.end(); I != E; ) {