r212591 - clang-format: Revamp function declaration/definition indentation.

Tobias Grosser tobias at grosser.es
Wed Jul 9 02:08:56 PDT 2014


On 09/07/2014 10:47, Daniel Jasper wrote:
> Yes, this is intended and I actually don't think that it is such a big
> difference. Multiline variable declaration that are broken after the type
> are actually reasonably rare.

In Polly alone it changes 180 lines (43 declarations)

LLVM has 276 command line declarations that are currently broken
after the type (grep -R 'cl::opt<.*>$' lib/ | wc):

static cl::opt<bool>
VarName("options, ...")

and 232 that are formatted

static cl::opt<std::string> OnlyFunction(
      "polly-only-func")

If you look at the last five commit messages that explicitly mention 
clang-format three contain formatting changes of exactly these constructs:

r212143:

-static cl::list<std::string> ArchFlags("arch",
-    cl::desc("architecture(s) from a Mach-O file to dump"),
-    cl::ZeroOrMore);
+static cl::list<std::string>
+ArchFlags("arch", cl::desc("architecture(s) from a Mach-O file to dump"),
+          cl::ZeroOrMore);


r212141:

-static cl::opt<OutputFormatTy>
-       OutputFormatShort(cl::desc("Specify output format"),
-         cl::values(clEnumValN(sysv, "A", "System V format"),
-                    clEnumValN(berkeley, "B", "Berkeley format"),
-                    clEnumValN(darwin, "m", "Darwin -m format"),
-                    clEnumValEnd),
-         cl::init(berkeley));
+OutputFormat("format", cl::desc("Specify output format"),
+             cl::values(clEnumVal(sysv, "System V format"),
+                        clEnumVal(berkeley, "Berkeley format"),
+                        clEnumVal(darwin, "Darwin -m format"), 
clEnumValEnd),
+             cl::init(berkeley));

r210182

-static cl::opt<bool>
-EnableAArch64UnscaledMemOp("aarch64-unscaled-mem-op", cl::Hidden,
-                         cl::desc("Allow AArch64 unscaled load/store 
combining"),
-                         cl::init(true));
+static cl::opt<bool> EnableAArch64UnscaledMemOp(
+    "aarch64-unscaled-mem-op", cl::Hidden,
+    cl::desc("Allow AArch64 unscaled load/store combining"), 
cl::init(true));

> Happy, to take a vote on this though..

Sure, would it be OK to revert this change meanwhile to get the build 
bot clean again.

Cheers,
Tobias





More information about the cfe-commits mailing list