From eb702350f7ac9c8910755fba44a98bc9a09beb4f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 29 Jul 2002 21:03:33 +0000 Subject: [PATCH] * Eliminate the Provided set. All Passes now finally just automatically provide themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3124 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h | 1 - include/llvm/CodeGen/FunctionLiveVarInfo.h | 1 - include/llvm/PassAnalysisSupport.h | 12 +++--------- lib/Analysis/LoopInfo.cpp | 1 - lib/Analysis/PostDominators.cpp | 1 - lib/VMCore/Dominators.cpp | 1 - 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h index ac21a266333..b120cc0a1b0 100644 --- a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h +++ b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h @@ -102,7 +102,6 @@ public: // getAnalysisUsage - Provide self! virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); } // --------- Functions to access analysis results ------------------- diff --git a/include/llvm/CodeGen/FunctionLiveVarInfo.h b/include/llvm/CodeGen/FunctionLiveVarInfo.h index ac21a266333..b120cc0a1b0 100644 --- a/include/llvm/CodeGen/FunctionLiveVarInfo.h +++ b/include/llvm/CodeGen/FunctionLiveVarInfo.h @@ -102,7 +102,6 @@ public: // getAnalysisUsage - Provide self! virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); } // --------- Functions to access analysis results ------------------- diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index e59399d48fe..092be346c7c 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -25,7 +25,7 @@ // class AnalysisUsage { // Sets of analyses required and preserved by a pass - std::vector Required, Preserved, Provided; + std::vector Required, Preserved; bool PreservesAll; public: AnalysisUsage() : PreservesAll(false) {} @@ -46,10 +46,6 @@ public: return *this; } - void addProvided(AnalysisID ID) { - Provided.push_back(ID); - } - // PreservesAll - Set by analyses that do not transform their input at all void setPreservesAll() { PreservesAll = true; } bool preservesAll() const { return PreservesAll; } @@ -67,13 +63,12 @@ public: const std::vector &getRequiredSet() const { return Required; } const std::vector &getPreservedSet() const { return Preserved; } - const std::vector &getProvidedSet() const { return Provided; } }; //===----------------------------------------------------------------------===// -// AnalysisResolver - Simple interface implemented by PassManagers objects that +// AnalysisResolver - Simple interface implemented by PassManager objects that // is used to pull analysis information out of them. // struct AnalysisResolver { @@ -87,8 +82,7 @@ struct AnalysisResolver { // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist Pass *getAnalysisToUpdate(AnalysisID ID) { - Pass *Result = getAnalysisOrNullUp(ID); - return Result; + return getAnalysisOrNullUp(ID); } virtual unsigned getDepth() const = 0; diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index ff5e2fa9dc6..8b3a4348228 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -73,7 +73,6 @@ void LoopInfo::Calculate(const DominatorSet &DS) { void LoopInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(DominatorSet::ID); - AU.addProvided(ID); } void LoopInfo::print(std::ostream &OS) const { diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index 9c960e3b0d4..3321e7ee4ed 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -148,7 +148,6 @@ bool PostDominatorSet::runOnFunction(Function &F) { // void PostDominatorSet::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); AU.addRequired(UnifyFunctionExitNodes::ID); } diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp index 9c960e3b0d4..3321e7ee4ed 100644 --- a/lib/VMCore/Dominators.cpp +++ b/lib/VMCore/Dominators.cpp @@ -148,7 +148,6 @@ bool PostDominatorSet::runOnFunction(Function &F) { // void PostDominatorSet::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); AU.addRequired(UnifyFunctionExitNodes::ID); }