aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-03-12 06:16:28 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-03-12 06:16:28 +0000
commit4230f40add2157100e2c0b94f98b04670a02d621 (patch)
treeba62309283697d39f08af8ce0a6aae522b93c891 /lib/VMCore
parentbc1dbe95b87a1931f9187597da26a1810250a40a (diff)
downloadexternal_llvm-4230f40add2157100e2c0b94f98b04670a02d621.zip
external_llvm-4230f40add2157100e2c0b94f98b04670a02d621.tar.gz
external_llvm-4230f40add2157100e2c0b94f98b04670a02d621.tar.bz2
Keep transitively-required passes alive for queries to work after the initial
user pass is destroyed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/PassManagerT.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h
index 5ffaebd..af5544c 100644
--- a/lib/VMCore/PassManagerT.h
+++ b/lib/VMCore/PassManagerT.h
@@ -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