From 3330e5be7ad80f89fd2baf8e153df97f23e04e7e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 28 Apr 2002 21:25:41 +0000 Subject: [PATCH] Move FunctionPass::doesNotModifyCFG to AnalysisUsage::preservesCFG() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2384 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Pass.h | 23 +++++++++++------------ lib/VMCore/Pass.cpp | 29 +++++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 251620cf9af..dbe485284c9 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -138,18 +138,6 @@ struct FunctionPass : public Pass { // bool run(Function *F); -protected: - // doesNotModifyCFG - This function should be called by our subclasses to - // implement the getAnalysisUsage virtual function, 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 doesNotModifyCFG(AnalysisUsage &Info); - private: friend class PassManagerT; friend class PassManagerT; @@ -277,6 +265,17 @@ public: void setPreservesAll() { PreservesAll = true; } bool preservesAll() const { return PreservesAll; } + // preservesCFG - This function should be called to 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(); + const std::vector &getRequiredSet() const { return Required; } const std::vector &getPreservedSet() const { return Preserved; } const std::vector &getProvidedSet() const { return Provided; } diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index ff9ac928b96..c3c9d456b5e 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -24,6 +24,21 @@ void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) { P->Resolver = AR; } + +// preservesCFG - This function should be called to 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 AnalysisUsage::preservesCFG() { + // FIXME: implement preservesCFG +} + + //===----------------------------------------------------------------------===// // PassManager implementation - The PassManager class is a simple Pimpl class // that wraps the PassManagerT template. @@ -142,20 +157,6 @@ void FunctionPass::addToPassManager(PassManagerT *PM, PM->addPass(this, AU); } -// doesNotModifyCFG - This function should be called by our subclasses to -// implement the getAnalysisUsage virtual function, 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 FunctionPass::doesNotModifyCFG(AnalysisUsage &Info) { - -} - - //===----------------------------------------------------------------------===// // BasicBlockPass Implementation //