mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -48,7 +48,7 @@ namespace {
|
||||
CallGraphSCCPass::getAnalysisUsage(AU);
|
||||
}
|
||||
|
||||
virtual bool runOnSCC(std::vector<CallGraphNode *> &SCC);
|
||||
virtual bool runOnSCC(CallGraphSCC &SCC);
|
||||
static char ID; // Pass identification, replacement for typeid
|
||||
SRETPromotion() : CallGraphSCCPass(&ID) {}
|
||||
|
||||
@ -69,12 +69,12 @@ Pass *llvm::createStructRetPromotionPass() {
|
||||
return new SRETPromotion();
|
||||
}
|
||||
|
||||
bool SRETPromotion::runOnSCC(std::vector<CallGraphNode *> &SCC) {
|
||||
bool SRETPromotion::runOnSCC(CallGraphSCC &SCC) {
|
||||
bool Changed = false;
|
||||
|
||||
for (unsigned i = 0, e = SCC.size(); i != e; ++i)
|
||||
if (CallGraphNode *NewNode = PromoteReturn(SCC[i])) {
|
||||
SCC[i] = NewNode;
|
||||
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I)
|
||||
if (CallGraphNode *NewNode = PromoteReturn(*I)) {
|
||||
SCC.ReplaceNode(*I, NewNode);
|
||||
Changed = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user