diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-16 22:42:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-16 22:42:17 +0000 |
commit | 4422d31b843bb3c8bf2d294f45dcbb029d58b7af (patch) | |
tree | d58c7b71bf6c6e709818d91dc530e92af57c5a62 /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | b90b6f1a352e95a0cf50a48a82605cc275d6f061 (diff) | |
download | bcm5719-llvm-4422d31b843bb3c8bf2d294f45dcbb029d58b7af.tar.gz bcm5719-llvm-4422d31b843bb3c8bf2d294f45dcbb029d58b7af.zip |
introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>. No functionality change,
but now we have a much tidier interface.
llvm-svn: 101558
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 03ec72c0304..07918543d40 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -292,14 +292,14 @@ bool Inliner::shouldInline(CallSite CS) { return true; } -bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { +bool Inliner::runOnSCC(CallGraphSCC &SCC) { CallGraph &CG = getAnalysis<CallGraph>(); const TargetData *TD = getAnalysisIfAvailable<TargetData>(); SmallPtrSet<Function*, 8> SCCFunctions; DEBUG(dbgs() << "Inliner visiting SCC:"); - for (unsigned i = 0, e = SCC.size(); i != e; ++i) { - Function *F = SCC[i]->getFunction(); + for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { + Function *F = (*I)->getFunction(); if (F) SCCFunctions.insert(F); DEBUG(dbgs() << " " << (F ? F->getName() : "INDIRECTNODE")); } @@ -309,8 +309,8 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { // from inlining other functions. SmallVector<CallSite, 16> CallSites; - for (unsigned i = 0, e = SCC.size(); i != e; ++i) { - Function *F = SCC[i]->getFunction(); + for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { + Function *F = (*I)->getFunction(); if (!F) continue; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) @@ -417,7 +417,7 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) { // swap/pop_back for efficiency, but do not use it if doing so would // move a call site to a function in this SCC before the // 'FirstCallInSCC' barrier. - if (SCC.size() == 1) { + if (SCC.isSingular()) { std::swap(CallSites[CSi], CallSites.back()); CallSites.pop_back(); } else { |