On 08/27/2013 07:24 AM, Daniel Jasper wrote:
Author: djasper
Date: Tue Aug 27 09:24:43 2013
New Revision: 189353

URL: http://llvm.org/viewvc/llvm-project?rev=189353&view=rev
Log:
clang-format: Format segments of builder-type calls one per line.

This fixes llvm.org/PR14818.

Before:
   return llvm::StringSwitch<Reference::Kind>(name)
              .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
              .StartsWith(".eh_frame", ORDER_EH_FRAME)
              .StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
              .StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);

After:
   return llvm::StringSwitch<Reference::Kind>(name)
              .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
              .StartsWith(".eh_frame", ORDER_EH_FRAME)
              .StartsWith(".init", ORDER_INIT)
              .StartsWith(".fini", ORDER_FINI)
              .StartsWith(".hash", ORDER_HASH)
              .Default(ORDER_TEXT);

This change introduced the following regression:

Before:

int foo() {
  if (1)
    if (1)
      if (1)
        O.indent(2 * (depth + 1))
            << "Node"
            << static_cast<void *>(RI->getTopLevelRegion()->getBBNode(*BI))
            << ";\n";
}

After:

int foo() {
  if (1)
    if (1)
      if (1)
        O.indent(2 * (depth + 1)) << "Node"
<< static_cast<void *>(RI->getTopLevelRegion()

->getBBNode(*BI))
                                  << ";\n";
}

I believe moving the << to a new line is better to read than adding a line break before the call to ->getBBNode().

Cheers,
Tobias
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to