[polly] r270054 - Move internal enum out of class declaration [NFC]

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 05:36:43 PDT 2016


Author: jdoerfert
Date: Thu May 19 07:36:43 2016
New Revision: 270054

URL: http://llvm.org/viewvc/llvm-project?rev=270054&view=rev
Log:
Move internal enum out of class declaration [NFC]

Modified:
    polly/trunk/include/polly/ScopDetection.h
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/include/polly/ScopDetection.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopDetection.h?rev=270054&r1=270053&r2=270054&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopDetection.h (original)
+++ polly/trunk/include/polly/ScopDetection.h Thu May 19 07:36:43 2016
@@ -203,13 +203,6 @@ private:
   AliasAnalysis *AA;
   //@}
 
-  /// @brief Enum for coloring BBs in Region.
-  ///
-  /// WHITE - Unvisited BB in DFS walk.
-  /// GREY - BBs which are currently on the DFS stack for processing.
-  /// BLACK - Visited and completely processed BB.
-  enum Color { WHITE, GREY, BLACK };
-
   /// @brief Map to remember detection contexts for all regions.
   using DetectionContextMapTy = DenseMap<BBPair, DetectionContext>;
   mutable DetectionContextMapTy DetectionContextMap;

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=270054&r1=270053&r2=270054&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu May 19 07:36:43 2016
@@ -1380,6 +1380,13 @@ void ScopDetection::emitMissedRemarks(co
   }
 }
 
+/// @brief Enum for coloring BBs in Region.
+///
+/// WHITE - Unvisited BB in DFS walk.
+/// GREY - BBs which are currently on the DFS stack for processing.
+/// BLACK - Visited and completely processed BB.
+enum Color { WHITE, GREY, BLACK };
+
 bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const {
   BasicBlock *REntry = R.getEntry();
   BasicBlock *RExit = R.getExit();
@@ -1394,10 +1401,10 @@ bool ScopDetection::isReducibleRegion(Re
 
   // Initialize the map for all BB with WHITE color.
   for (auto *BB : R.blocks())
-    BBColorMap[BB] = ScopDetection::WHITE;
+    BBColorMap[BB] = WHITE;
 
   // Process the entry block of the Region.
-  BBColorMap[CurrBB] = ScopDetection::GREY;
+  BBColorMap[CurrBB] = GREY;
   DFSStack.push(std::make_pair(CurrBB, 0));
 
   while (!DFSStack.empty()) {
@@ -1418,15 +1425,15 @@ bool ScopDetection::isReducibleRegion(Re
         continue;
 
       // WHITE indicates an unvisited BB in DFS walk.
-      if (BBColorMap[SuccBB] == ScopDetection::WHITE) {
+      if (BBColorMap[SuccBB] == WHITE) {
         // Push the current BB and the index of the next child to be visited.
         DFSStack.push(std::make_pair(CurrBB, I + 1));
         // Push the next BB to be processed.
         DFSStack.push(std::make_pair(SuccBB, 0));
         // First time the BB is being processed.
-        BBColorMap[SuccBB] = ScopDetection::GREY;
+        BBColorMap[SuccBB] = GREY;
         break;
-      } else if (BBColorMap[SuccBB] == ScopDetection::GREY) {
+      } else if (BBColorMap[SuccBB] == GREY) {
         // GREY indicates a loop in the control flow.
         // If the destination dominates the source, it is a natural loop
         // else, an irreducible control flow in the region is detected.
@@ -1441,7 +1448,7 @@ bool ScopDetection::isReducibleRegion(Re
     // If all children of current BB have been processed,
     // then mark that BB as fully processed.
     if (AdjacentBlockIndex == NSucc)
-      BBColorMap[CurrBB] = ScopDetection::BLACK;
+      BBColorMap[CurrBB] = BLACK;
   }
 
   return true;




More information about the llvm-commits mailing list