[polly] r272462 - ScopDetection: Make enum function-local

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 11 02:00:37 PDT 2016


Author: grosser
Date: Sat Jun 11 04:00:37 2016
New Revision: 272462

URL: http://llvm.org/viewvc/llvm-project?rev=272462&view=rev
Log:
ScopDetection: Make enum function-local

The 'Color' enum is only used for irreducible control flow detection. Johannes
already moved this enum in r270054 from ScopDetection.h to ScopDetection.cpp to
limit its scope to a single cpp file. We now move it into the only function
where this enum is needed to make clear that it is only needed locally in this
single function.

Thanks to Johannes for pointing out this cleanup opportunity.

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

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=272462&r1=272461&r2=272462&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sat Jun 11 04:00:37 2016
@@ -1380,14 +1380,14 @@ 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 {
+  /// @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 };
+
   BasicBlock *REntry = R.getEntry();
   BasicBlock *RExit = R.getExit();
   // Map to match the color of a BasicBlock during the DFS walk.




More information about the llvm-commits mailing list