From cb2610ea037a17115ef3a01a6bdaab4e3cfdca27 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Oct 2002 20:00:28 +0000 Subject: [PATCH] - 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 --- include/llvm/PassAnalysisSupport.h | 21 ++++++++++--------- .../Instrumentation/TraceValues.cpp | 2 +- lib/Transforms/LevelRaise.cpp | 2 +- lib/Transforms/Scalar/ConstantProp.cpp | 2 +- lib/Transforms/Scalar/DCE.cpp | 4 ++-- lib/Transforms/Scalar/GCSE.cpp | 2 +- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 +- .../Scalar/InstructionCombining.cpp | 2 +- lib/Transforms/Scalar/LICM.cpp | 2 +- lib/Transforms/Scalar/PiNodeInsertion.cpp | 2 +- lib/Transforms/Scalar/Reassociate.cpp | 2 +- lib/Transforms/Scalar/SCCP.cpp | 2 +- .../Utils/PromoteMemoryToRegister.cpp | 2 +- lib/VMCore/Pass.cpp | 4 ++-- lib/VMCore/PassManagerT.h | 4 ++-- 15 files changed, 28 insertions(+), 27 deletions(-) diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index 82fc9cb1b2d..38987b56159 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -61,17 +61,18 @@ public: // setPreservesAll - Set by analyses that do not transform their input at all 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: - // - // 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. - // - void preservesCFG(); + /// 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. + /// + /// This function annotates the AnalysisUsage info object to say that analyses + /// that only depend on the CFG are preserved by this pass. + /// + void setPreservesCFG(); const std::vector &getRequiredSet() const { return Required; } const std::vector &getPreservedSet() const { return Preserved; } diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp index f17932b2ebf..431b9bb83dd 100644 --- a/lib/Transforms/Instrumentation/TraceValues.cpp +++ b/lib/Transforms/Instrumentation/TraceValues.cpp @@ -78,7 +78,7 @@ namespace { bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } }; diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index f246116a2ee..6ea60059eae 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -569,7 +569,7 @@ namespace { virtual bool runOnFunction(Function &F) { return doRPR(F); } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } }; } diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index 1c0d33bee82..b7dde4a113e 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -27,7 +27,7 @@ namespace { bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } }; diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp index cfeb8685893..36a597a19dc 100644 --- a/lib/Transforms/Scalar/DCE.cpp +++ b/lib/Transforms/Scalar/DCE.cpp @@ -38,7 +38,7 @@ namespace { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } }; @@ -60,7 +60,7 @@ namespace { virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } }; diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index e5f10c849f4..771b9690fad 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/lib/Transforms/Scalar/GCSE.cpp @@ -39,7 +39,7 @@ namespace { // This transformation requires dominator and immediate dominator info virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); AU.addRequired(); AU.addRequired(); AU.addRequired(); diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index d7433802ee5..ff2b9939c70 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -190,7 +190,7 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); - AU.preservesCFG(); + AU.setPreservesCFG(); } }; RegisterOpt X("indvars", diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 74a1496bfac..dab702dba01 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -53,7 +53,7 @@ namespace { virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } // Visitation implementation - Implement instruction combining for different diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 998dce937b2..549bf60044a 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -29,7 +29,7 @@ namespace { /// loop preheaders be inserted into the CFG... /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); AU.addRequiredID(LoopPreheadersID); AU.addRequired(); AU.addRequired(); diff --git a/lib/Transforms/Scalar/PiNodeInsertion.cpp b/lib/Transforms/Scalar/PiNodeInsertion.cpp index 9d431951d7c..4f52051e61b 100644 --- a/lib/Transforms/Scalar/PiNodeInsertion.cpp +++ b/lib/Transforms/Scalar/PiNodeInsertion.cpp @@ -42,7 +42,7 @@ namespace { virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); AU.addRequired(); } diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 608ab52510c..50d89ece951 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -37,7 +37,7 @@ namespace { bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } private: void BuildRankMap(Function &F); diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 1540767d3b8..5ae9f522636 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -96,7 +96,7 @@ public: bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.preservesCFG(); + AU.setPreservesCFG(); } diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index a526694c300..d8f53fb8808 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -55,7 +55,7 @@ namespace { // virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); - AU.preservesCFG(); + AU.setPreservesCFG(); } private: diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 0be92e9f551..96a4a3c02be 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -43,7 +43,7 @@ void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) { // 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: // // 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 // 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 // that only depend on the CFG (like dominators, loop info, etc...) // diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index 1082ebfad5b..d65a69482b0 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -252,7 +252,7 @@ public: // Erase all analyses not in the preserved set... - if (!AnUsage.preservesAll()) { + if (!AnUsage.getPreservesAll()) { const std::vector &PreservedSet = AnUsage.getPreservedSet(); for (std::map::iterator I = CurrentAnalyses.begin(), E = CurrentAnalyses.end(); I != E; ) @@ -472,7 +472,7 @@ private: markPassUsed(*I, P); // Mark *I as used by P // Erase all analyses not in the preserved set... - if (!AnUsage.preservesAll()) { + if (!AnUsage.getPreservesAll()) { const std::vector &PreservedSet = AnUsage.getPreservedSet(); for (std::map::iterator I = CurrentAnalyses.begin(), E = CurrentAnalyses.end(); I != E; ) {