If pass reserves all analysis info then each info is not separately
authorDevang Patel <dpatel@apple.com>
Thu, 7 Dec 2006 20:03:49 +0000 (20:03 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 7 Dec 2006 20:03:49 +0000 (20:03 +0000)
included in PreservedSet. So check getPreservesAll() first.

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

lib/VMCore/PassManager.cpp

index 9585b0dbce36c7c54f4e6a31797cff93ea1bed67..77820ad6a8e6bd41d4e3c57f7ec18769ada19395 100644 (file)
@@ -436,8 +436,11 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) {
 void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);
-  const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
 
+  if (AnUsage.getPreservesAll())
+    return;
+
+  const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
   for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
          E = AvailableAnalysis.end(); I != E; ++I ) {
     if (std::find(PreservedSet.begin(), PreservedSet.end(), I->first) == 
@@ -470,8 +473,8 @@ void PMDataManager::removeDeadPasses(Pass *P) {
 
 /// Add pass P into the PassVector. Update 
 /// AvailableAnalysis appropriately if ProcessAnalysis is true.
-void PMDataManager::addPassToManager (Pass *P, 
-                                              bool ProcessAnalysis) {
+void PMDataManager::addPassToManager(Pass *P, 
+                                     bool ProcessAnalysis) {
 
   if (ProcessAnalysis) {
     // Take a note of analysis required and made available by this pass