Keep transitively-required passes alive for queries to work after the initial
authorMisha Brukman <brukman+llvm@gmail.com>
Fri, 12 Mar 2004 06:16:28 +0000 (06:16 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Fri, 12 Mar 2004 06:16:28 +0000 (06:16 +0000)
user pass is destroyed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12332 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManagerT.h

index 5ffaebdd78627dedceede4003f512aea0526d7e1..af5544cd98da6e1da0d0b04e94a298c03f3b4dfd 100644 (file)
@@ -208,7 +208,6 @@ public:
                                           E = LastUseOf.end(); I != E; ++I)
       LastUserOf[I->second].push_back(I->first);
 
-
     // Output debug information...
     if (Parent == 0) PMDebug::PerformPassStartupStuff(this);
 
@@ -397,6 +396,16 @@ public:
 
     if (I != CurrentAnalyses.end()) {
       LastUseOf[I->second] = User;    // Local pass, extend the lifetime
+
+      // Prolong live range of analyses that are needed after an analysis pass
+      // is destroyed, for querying by subsequent passes
+      AnalysisUsage AnUsage;
+      I->second->getAnalysisUsage(AnUsage);
+      const std::vector<AnalysisID> &IDs = AnUsage.getRequiredTransitiveSet();
+      for (std::vector<AnalysisID>::const_iterator i = IDs.begin(),
+             e = IDs.end(); i != e; ++i)
+        markPassUsed(*i, User);
+
     } else {
       // Pass not in current available set, must be a higher level pass
       // available to us, propagate to parent pass manager...  We tell the