[PATCH] Add support for foreach macros to clang-format

David Majnemer david.majnemer at gmail.com
Sun Mar 2 15:05:06 PST 2014


  Would be neat if the option could take regular expressions.  The linux kernel contains many foreach macros and it would be nice to concisely match them. :)


================
Comment at: lib/Format/FormatToken.cpp:67
@@ +66,3 @@
+    if (Name == *I)
+      return true;
+  }
----------------
Can't this be `std::find(std::begin(Style.ForEachMacros), std::end(Style.ForEachMacros), Name) != std::end(Style.ForEachMacros)`; ?


http://llvm-reviews.chandlerc.com/D2919



More information about the cfe-commits mailing list