diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index 376e1b798e9..d48c198bbff 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -594,8 +594,13 @@ void PMDataManager::add(Pass *P, } } - LastUses.push_back(P); - TPM->setLastUser(LastUses, P); + // Set P as P's last user until someone starts using P. + // However, if P is a Pass Manager then it does not need + // to record its last user. + if (!dynamic_cast<PMDataManager *>(P)) { + LastUses.push_back(P); + TPM->setLastUser(LastUses, P); + } // Take a note of analysis required and made available by this pass. // Remove the analysis not preserved by this pass |