diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-20 21:30:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-20 21:30:06 +0000 |
commit | a10df5028211fc897751d23e91d035db47d23fac (patch) | |
tree | b517b8b12003fdcd1ddd2af08b6817c25e0ae608 /lib/Analysis/IPA | |
parent | c99acc3709f789baaf75b4ab3e1907b0226d620b (diff) | |
download | external_llvm-a10df5028211fc897751d23e91d035db47d23fac.zip external_llvm-a10df5028211fc897751d23e91d035db47d23fac.tar.gz external_llvm-a10df5028211fc897751d23e91d035db47d23fac.tar.bz2 |
Add the ability for SCC passes to initialize and finalize themselves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index e9ab650..23aedb0 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -18,8 +18,7 @@ #include "llvm/CallGraphSCCPass.h" #include "llvm/Analysis/CallGraph.h" #include "Support/SCCIterator.h" - -namespace llvm { +using namespace llvm; /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should @@ -31,11 +30,9 @@ void CallGraphSCCPass::getAnalysisUsage(AnalysisUsage &AU) const { bool CallGraphSCCPass::run(Module &M) { CallGraph &CG = getAnalysis<CallGraph>(); - bool Changed = false; + bool Changed = doInitialization(M); for (scc_iterator<CallGraph*> I = scc_begin(&CG), E = scc_end(&CG); I != E; ++I) Changed = runOnSCC(*I); - return Changed; + return Changed | doFinalization(M); } - -} // End llvm namespace |