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

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


On Wed, Jun 8, 2016, at 11:05 AM, Johannes Doerfert via llvm-commits
wrote:
> On 06/07, Tobias Grosser wrote:
> > On 05/19/2016 02:36 PM, Johannes Doerfert via llvm-commits wrote:
> > > 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]
> > 
> > Nice cleanup.
> > 
> > > 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 };
> > 
> > You could probably even have moved this inside the function itself.
> Feel free to do this yourself, it is not my code anyway.

I did this in r272462. Thanks for pointing out this opportunity.

Best,
Tobias

PS: Not sure why it is relevant if this is your code or not. I am
obviously thankful for you cleaning up code that you did not write
yourself. Independently of who wrote the code, it still seems useful to
point out additional cleanup opportunities that one sees when looking at
your changes. I for example just learned that function-local enums are
allowed in C++. Not sure if this was new to you or not, but as your goal
seemed to limit the scope, I thought it might be useful to point out
this possibility.


More information about the llvm-commits mailing list