[PM] Don't run the machinery of invalidating all the analysis passes
[oota-llvm.git] / include / llvm / IR / PassManager.h
index b2bf73ffe8b4b5d5af93bd41ad31fefe3a82cf60..59855b5fc91c845f1788aa40bb6694fe4a56c2d7 100644 (file)
@@ -141,15 +141,19 @@ public:
            PreservedPassIDs.count(PassID);
   }
 
+  /// \brief Test whether all passes are preserved.
+  ///
+  /// This is used primarily to optimize for the case of no changes which will
+  /// common in many scenarios.
+  bool areAllPreserved() const {
+    return PreservedPassIDs.count((void *)AllPassesID);
+  }
+
 private:
   // Note that this must not be -1 or -2 as those are already used by the
   // SmallPtrSet.
   static const uintptr_t AllPassesID = (intptr_t)(-3);
 
-  bool areAllPreserved() const {
-    return PreservedPassIDs.count((void *)AllPassesID);
-  }
-
   SmallPtrSet<void *, 2> PreservedPassIDs;
 };