From 05498bc768727e56941be4d156bb0dfecef9ff0e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 31 Aug 2003 19:46:48 +0000 Subject: [PATCH] Remove explicit passing of SCC's around as objects. llvm-svn: 8267 --- include/llvm/Analysis/MemoryDepAnalysis.h | 4 ++-- lib/Analysis/IPA/MemoryDepAnalysis.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/llvm/Analysis/MemoryDepAnalysis.h b/include/llvm/Analysis/MemoryDepAnalysis.h index 82a0d77761f..f4b96b9907f 100644 --- a/include/llvm/Analysis/MemoryDepAnalysis.h +++ b/include/llvm/Analysis/MemoryDepAnalysis.h @@ -15,7 +15,6 @@ #include "llvm/Analysis/DependenceGraph.h" #include "llvm/Pass.h" -#include "Support/TarjanSCCIterator.h" #include "Support/hash_map" class ModRefTable; @@ -43,7 +42,8 @@ class MemoryDepAnalysis : public Pass { const FunctionModRefInfo* funcModRef; /// Internal routine that processes each SCC of the CFG. - void ProcessSCC(SCC& S, ModRefTable& ModRefAfter); + void ProcessSCC(std::vector &SCC, ModRefTable& ModRefAfter, + bool HasLoop); friend class PgmDependenceGraph; diff --git a/lib/Analysis/IPA/MemoryDepAnalysis.cpp b/lib/Analysis/IPA/MemoryDepAnalysis.cpp index 685b2eeed76..215b4e2ba71 100644 --- a/lib/Analysis/IPA/MemoryDepAnalysis.cpp +++ b/lib/Analysis/IPA/MemoryDepAnalysis.cpp @@ -271,14 +271,12 @@ void MemoryDepAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { /// } /// /// -void MemoryDepAnalysis::ProcessSCC(SCC& S, - ModRefTable& ModRefAfter) { +void MemoryDepAnalysis::ProcessSCC(std::vector &S, + ModRefTable& ModRefAfter, bool hasLoop) { ModRefTable ModRefCurrent; ModRefTable::ModRefMap& mapCurrent = ModRefCurrent.modRefMap; ModRefTable::ModRefMap& mapAfter = ModRefAfter.modRefMap; - bool hasLoop = S.HasLoop(); - // Builder class fills out a ModRefTable one instruction at a time. // To use it, we just invoke it's visit function for each basic block: // @@ -290,7 +288,8 @@ void MemoryDepAnalysis::ProcessSCC(SCC& S, // : Add I to ModRefCurrent.users if it uses any node // ModRefInfoBuilder builder(*funcGraph, *funcModRef, ModRefCurrent); - for (SCC::iterator BI=S.begin(), BE=S.end(); BI != BE; ++BI) + for (std::vector::iterator BI = S.begin(), BE = S.end(); + BI != BE; ++BI) // Note: BBs in the SCC<> created by TarjanSCCIterator are in postorder. for (BasicBlock::reverse_iterator II=(*BI)->rbegin(), IE=(*BI)->rend(); II != IE; ++II) @@ -442,7 +441,7 @@ bool MemoryDepAnalysis::runOnFunction(Function &F) { SCC* nextSCC; for (TarjanSCC_iterator I = tarj_begin(&F), E = tarj_end(&F); I != E; ++I) - ProcessSCC(*I, ModRefAfter); + ProcessSCC(*I, ModRefAfter, (*I).HasLoop()); return true; }