[llvm] r282513 - [SCEV] Reduce the scope of a struct; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 11:01:44 PDT 2016


Author: sanjoy
Date: Tue Sep 27 13:01:44 2016
New Revision: 282513

URL: http://llvm.org/viewvc/llvm-project?rev=282513&view=rev
Log:
[SCEV] Reduce the scope of a struct; NFC

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=282513&r1=282512&r2=282513&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Sep 27 13:01:44 2016
@@ -3343,31 +3343,29 @@ bool ScalarEvolution::checkValidity(cons
   return !F.FindOne;
 }
 
-namespace {
-// Helper class working with SCEVTraversal to figure out if a SCEV contains
-// a sub SCEV of scAddRecExpr type.  FindInvalidSCEVUnknown::FoundOne is set
-// iff if such sub scAddRecExpr type SCEV is found.
-struct FindAddRecurrence {
-  bool FoundOne;
-  FindAddRecurrence() : FoundOne(false) {}
+bool ScalarEvolution::containsAddRecurrence(const SCEV *S) {
+  // Helper class working with SCEVTraversal to figure out if a SCEV contains a
+  // sub SCEV of scAddRecExpr type.  FindInvalidSCEVUnknown::FoundOne is set iff
+  // if such sub scAddRecExpr type SCEV is found.
+  struct FindAddRecurrence {
+    bool FoundOne;
+    FindAddRecurrence() : FoundOne(false) {}
 
-  bool follow(const SCEV *S) {
-    switch (static_cast<SCEVTypes>(S->getSCEVType())) {
-    case scAddRecExpr:
-      FoundOne = true;
-    case scConstant:
-    case scUnknown:
-    case scCouldNotCompute:
-      return false;
-    default:
-      return true;
+    bool follow(const SCEV *S) {
+      switch (static_cast<SCEVTypes>(S->getSCEVType())) {
+      case scAddRecExpr:
+        FoundOne = true;
+      case scConstant:
+      case scUnknown:
+      case scCouldNotCompute:
+        return false;
+      default:
+        return true;
+      }
     }
-  }
-  bool isDone() const { return FoundOne; }
-};
-}
+    bool isDone() const { return FoundOne; }
+  };
 
-bool ScalarEvolution::containsAddRecurrence(const SCEV *S) {
   HasRecMapType::iterator I = HasRecMap.find_as(S);
   if (I != HasRecMap.end())
     return I->second;




More information about the llvm-commits mailing list