@@ -607,8 +607,7 @@ void PMTopLevelManager::schedulePass(Pass *P) {
607
607
// If P is an analysis pass and it is available then do not
608
608
// generate the analysis again. Stale analysis info should not be
609
609
// available at this point.
610
- const PassInfo *PI =
611
- PassRegistry::getPassRegistry ()->getPassInfo (P->getPassID ());
610
+ const PassInfo *PI = P->getPassInfo ();
612
611
if (PI && PI->isAnalysis () && findAnalysisPass (P->getPassID ())) {
613
612
delete P;
614
613
return ;
@@ -723,8 +722,7 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
723
722
return *I;
724
723
725
724
// If Pass not found then check the interfaces implemented by Immutable Pass
726
- const PassInfo *PassInf =
727
- PassRegistry::getPassRegistry ()->getPassInfo (PI);
725
+ const PassInfo *PassInf = (*I)->getPassInfo ();
728
726
assert (PassInf && " Expected all immutable passes to be initialized" );
729
727
const std::vector<const PassInfo*> &ImmPI =
730
728
PassInf->getInterfacesImplemented ();
@@ -766,8 +764,7 @@ void PMTopLevelManager::dumpArguments() const {
766
764
dbgs () << " Pass Arguments: " ;
767
765
for (SmallVectorImpl<ImmutablePass *>::const_iterator I =
768
766
ImmutablePasses.begin (), E = ImmutablePasses.end (); I != E; ++I)
769
- if (const PassInfo *PI =
770
- PassRegistry::getPassRegistry ()->getPassInfo ((*I)->getPassID ())) {
767
+ if (const PassInfo *PI = (*I)->getPassInfo ()) {
771
768
assert (PI && " Expected all immutable passes to be initialized" );
772
769
if (!PI->isAnalysisGroup ())
773
770
dbgs () << " -" << PI->getPassArgument ();
@@ -831,8 +828,8 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) {
831
828
832
829
// This pass is the current implementation of all of the interfaces it
833
830
// implements as well.
834
- const PassInfo *PInf = PassRegistry::getPassRegistry () ->getPassInfo (PI );
835
- if (! PInf) return ;
831
+ const PassInfo *PInf = P ->getPassInfo ();
832
+ if (PInf == 0 ) return ;
836
833
const std::vector<const PassInfo*> &II = PInf->getInterfacesImplemented ();
837
834
for (unsigned i = 0 , e = II.size (); i != e; ++i)
838
835
AvailableAnalysis[II[i]->getTypeInfo ()] = P;
@@ -963,10 +960,9 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
963
960
P->releaseMemory ();
964
961
}
965
962
966
- AnalysisID PI = P->getPassID ();
967
- if (const PassInfo *PInf = PassRegistry::getPassRegistry ()->getPassInfo (PI)) {
963
+ if (const PassInfo *PInf = P->getPassInfo ()) {
968
964
// Remove the pass itself (if it is not already removed).
969
- AvailableAnalysis.erase (PI );
965
+ AvailableAnalysis.erase (P-> getPassID () );
970
966
971
967
// Remove all interfaces this pass implements, for which it is also
972
968
// listed as the available implementation.
@@ -1148,8 +1144,7 @@ void PMDataManager::dumpPassArguments() const {
1148
1144
if (PMDataManager *PMD = (*I)->getAsPMDataManager ())
1149
1145
PMD->dumpPassArguments ();
1150
1146
else
1151
- if (const PassInfo *PI =
1152
- PassRegistry::getPassRegistry ()->getPassInfo ((*I)->getPassID ()))
1147
+ if (const PassInfo *PI = (*I)->getPassInfo ())
1153
1148
if (!PI->isAnalysisGroup ())
1154
1149
dbgs () << " -" << PI->getPassArgument ();
1155
1150
}
0 commit comments