mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Move the code in TargetPassConfig::addPass that inserts machine printer pass to
the overloaded version of addPass which takes Pass*. This change enables inserting the machine printer pass when the overloaded version of addPass that takes Pass* is called to add a pass, instead of the one which takes AnalysisID. I need this to prevent make-check tests from failing when I commit another patch later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -295,6 +295,24 @@ void TargetPassConfig::addPass(Pass *P, bool verifyAfter, bool printAfter) {
|
|||||||
if (verifyAfter)
|
if (verifyAfter)
|
||||||
addVerifyPass(Banner);
|
addVerifyPass(Banner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the passes after the pass P if there is any.
|
||||||
|
for (SmallVectorImpl<std::pair<AnalysisID, IdentifyingPassPtr> >::iterator
|
||||||
|
I = Impl->InsertedPasses.begin(),
|
||||||
|
E = Impl->InsertedPasses.end();
|
||||||
|
I != E; ++I) {
|
||||||
|
if ((*I).first == PassID) {
|
||||||
|
assert((*I).second.isValid() && "Illegal Pass ID!");
|
||||||
|
Pass *NP;
|
||||||
|
if ((*I).second.isInstance())
|
||||||
|
NP = (*I).second.getInstance();
|
||||||
|
else {
|
||||||
|
NP = Pass::createPass((*I).second.getID());
|
||||||
|
assert(NP && "Pass ID not registered");
|
||||||
|
}
|
||||||
|
addPass(NP, false, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
delete P;
|
delete P;
|
||||||
}
|
}
|
||||||
@ -329,22 +347,6 @@ AnalysisID TargetPassConfig::addPass(AnalysisID PassID, bool verifyAfter,
|
|||||||
AnalysisID FinalID = P->getPassID();
|
AnalysisID FinalID = P->getPassID();
|
||||||
addPass(P, verifyAfter, printAfter); // Ends the lifetime of P.
|
addPass(P, verifyAfter, printAfter); // Ends the lifetime of P.
|
||||||
|
|
||||||
// Add the passes after the pass P if there is any.
|
|
||||||
for (SmallVectorImpl<std::pair<AnalysisID, IdentifyingPassPtr> >::iterator
|
|
||||||
I = Impl->InsertedPasses.begin(), E = Impl->InsertedPasses.end();
|
|
||||||
I != E; ++I) {
|
|
||||||
if ((*I).first == PassID) {
|
|
||||||
assert((*I).second.isValid() && "Illegal Pass ID!");
|
|
||||||
Pass *NP;
|
|
||||||
if ((*I).second.isInstance())
|
|
||||||
NP = (*I).second.getInstance();
|
|
||||||
else {
|
|
||||||
NP = Pass::createPass((*I).second.getID());
|
|
||||||
assert(NP && "Pass ID not registered");
|
|
||||||
}
|
|
||||||
addPass(NP, false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FinalID;
|
return FinalID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user