@@ -602,8 +602,7 @@ void PMTopLevelManager::schedulePass(Pass *P) {
602
602
// If P is an analysis pass and it is available then do not
603
603
// generate the analysis again. Stale analysis info should not be
604
604
// available at this point.
605
- const PassInfo *PI =
606
- PassRegistry::getPassRegistry ()->getPassInfo (P->getPassID ());
605
+ const PassInfo *PI = P->getPassInfo ();
607
606
if (PI && PI->isAnalysis () && findAnalysisPass (P->getPassID ())) {
608
607
delete P;
609
608
return ;
@@ -718,8 +717,7 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
718
717
return *I;
719
718
720
719
// If Pass not found then check the interfaces implemented by Immutable Pass
721
- const PassInfo *PassInf =
722
- PassRegistry::getPassRegistry ()->getPassInfo (PI);
720
+ const PassInfo *PassInf = (*I)->getPassInfo ();
723
721
assert (PassInf && " Expected all immutable passes to be initialized" );
724
722
const std::vector<const PassInfo*> &ImmPI =
725
723
PassInf->getInterfacesImplemented ();
@@ -761,8 +759,7 @@ void PMTopLevelManager::dumpArguments() const {
761
759
dbgs () << " Pass Arguments: " ;
762
760
for (SmallVectorImpl<ImmutablePass *>::const_iterator I =
763
761
ImmutablePasses.begin (), E = ImmutablePasses.end (); I != E; ++I)
764
- if (const PassInfo *PI =
765
- PassRegistry::getPassRegistry ()->getPassInfo ((*I)->getPassID ())) {
762
+ if (const PassInfo *PI = (*I)->getPassInfo ()) {
766
763
assert (PI && " Expected all immutable passes to be initialized" );
767
764
if (!PI->isAnalysisGroup ())
768
765
dbgs () << " -" << PI->getPassArgument ();
@@ -826,7 +823,7 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) {
826
823
827
824
// This pass is the current implementation of all of the interfaces it
828
825
// implements as well.
829
- const PassInfo *PInf = PassRegistry::getPassRegistry () ->getPassInfo (PI );
826
+ const PassInfo *PInf = P ->getPassInfo ();
830
827
if (PInf == 0 ) return ;
831
828
const std::vector<const PassInfo*> &II = PInf->getInterfacesImplemented ();
832
829
for (unsigned i = 0 , e = II.size (); i != e; ++i)
@@ -958,10 +955,9 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
958
955
P->releaseMemory ();
959
956
}
960
957
961
- AnalysisID PI = P->getPassID ();
962
- if (const PassInfo *PInf = PassRegistry::getPassRegistry ()->getPassInfo (PI)) {
958
+ if (const PassInfo *PInf = P->getPassInfo ()) {
963
959
// Remove the pass itself (if it is not already removed).
964
- AvailableAnalysis.erase (PI );
960
+ AvailableAnalysis.erase (P-> getPassID () );
965
961
966
962
// Remove all interfaces this pass implements, for which it is also
967
963
// listed as the available implementation.
@@ -1143,8 +1139,7 @@ void PMDataManager::dumpPassArguments() const {
1143
1139
if (PMDataManager *PMD = (*I)->getAsPMDataManager ())
1144
1140
PMD->dumpPassArguments ();
1145
1141
else
1146
- if (const PassInfo *PI =
1147
- PassRegistry::getPassRegistry ()->getPassInfo ((*I)->getPassID ()))
1142
+ if (const PassInfo *PI = (*I)->getPassInfo ())
1148
1143
if (!PI->isAnalysisGroup ())
1149
1144
dbgs () << " -" << PI->getPassArgument ();
1150
1145
}
0 commit comments