[polly] r202648 - PollyDectect: Use spaces before foreach colons

Tobias Grosser tobias at grosser.es
Sun Mar 2 08:28:25 PST 2014


Author: grosser
Date: Sun Mar  2 10:28:24 2014
New Revision: 202648

URL: http://llvm.org/viewvc/llvm-project?rev=202648&view=rev
Log:
PollyDectect: Use spaces before foreach colons

clang-format requires a space before the ":" in the foreach loop. Even though
this is surprising to me, we follow this style to make our formatting
consistent with clang-format. I found that this clang-format style is used in a
couple of C++11 examples, hence I believe the fact that clang-format adds a
colon is not a bug but just something I was not used to yet.

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=202648&r1=202647&r2=202648&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Mar  2 10:28:24 2014
@@ -332,7 +332,7 @@ std::string ScopDetection::formatInvalid
 
   std::vector<Value *> Pointers;
 
-  for (auto I: AS)
+  for (auto I : AS)
     Pointers.push_back(I.getValue());
 
   std::sort(Pointers.begin(), Pointers.end());
@@ -607,7 +607,7 @@ static bool regionWithoutLoops(Region &R
 static unsigned eraseAllChildren(std::set<const Region *> &Regs,
                                  const Region *R) {
   unsigned Count = 0;
-  for (auto SubRegion: *R) {
+  for (auto SubRegion : *R) {
     if (Regs.find(SubRegion) != Regs.end()) {
       ++Count;
       Regs.erase(SubRegion);
@@ -633,7 +633,7 @@ void ScopDetection::findScops(Region &R)
 
   InvalidRegions[&R] = LastFailure;
 
-  for (auto SubRegion: R)
+  for (auto SubRegion : R)
     findScops(*SubRegion);
 
   // Try to expand regions.
@@ -644,10 +644,10 @@ void ScopDetection::findScops(Region &R)
 
   std::vector<Region *> ToExpand;
 
-  for (auto SubRegion: R)
+  for (auto SubRegion : R)
     ToExpand.push_back(SubRegion);
 
-  for (auto CurrentRegion: ToExpand) {
+  for (auto CurrentRegion : ToExpand) {
     // Skip invalid regions. Regions may become invalid, if they are element of
     // an already expanded region.
     if (ValidRegions.find(CurrentRegion) == ValidRegions.end())
@@ -800,7 +800,7 @@ void ScopDetection::getDebugLocation(con
 }
 
 void ScopDetection::printLocations(llvm::Function &F) {
-  for (auto R: *this) {
+  for (auto R : *this) {
     unsigned LineEntry, LineExit;
     std::string FileName;
 
@@ -846,7 +846,7 @@ void polly::ScopDetection::verifyAnalysi
   if (!VerifyScops)
     return;
 
-  for (auto R: ValidRegions)
+  for (auto R : ValidRegions)
     verifyRegion(*R);
 }
 
@@ -862,7 +862,7 @@ void ScopDetection::getAnalysisUsage(Ana
 }
 
 void ScopDetection::print(raw_ostream &OS, const Module *) const {
-  for (auto R: ValidRegions)
+  for (auto R : ValidRegions)
     OS << "Valid Region for Scop: " << R->getNameStr() << '\n';
 
   OS << "\n";





More information about the llvm-commits mailing list