I believe builders already have a special case - not sure if this would affect those<br><br>Daniel - got a diff of what changes in LLVM between a format of the whole project with/without this change?<br><div>On Sat Jan 11 2014 at 11:39:43 AM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's a lot of stuff that looks like this:<br>
<br>
      MIB = BuildMI(mainMBB, DL, TII->get(X86::CMOV_GR32), cc)<br>
              .addReg(cH32).addReg(cL32)<br>
              .addImm(X86::COND_E);<br>
<br>
in the various backends.<br>
<br>
-eric<br>
<br>
<br>
On Sat, Jan 11, 2014 at 11:25 AM, <a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a> <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> If we're voting, I'll put up a hand for the first style (breaking before<br>
> '.') - but wouldn't mind seeing the real-world examples in LLVM that go<br>
> either way to get a better sense of how this looks in the real world.<br>
><br>
><br>
> On Fri Jan 10 2014 at 11:20:02 AM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>><br>
> wrote:<br>
>><br>
>><br>
>><br>
>> On Fri Jan 10 2014 at 1:43:37 AM, Daniel Jasper <<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>><br>
>> wrote:<br>
>><br>
>> On Fri, Jan 10, 2014 at 10:07 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>><br>
>> wrote:<br>
>><br>
>> On Fri, Jan 10, 2014 at 12:40 AM, Daniel Jasper <<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>><br>
>> wrote:<br>
>><br>
>> Author: djasper<br>
>> Date: Fri Jan 10 02:40:17 2014<br>
>> New Revision: 198924<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=198924&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=198924&view=rev</a><br>
>> Log:<br>
>> clang-format: Slightly adapt line break in edge case.<br>
>><br>
>> Before:<br>
>>   SomeMap[std::pair(<u></u>aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]<br>
>>       .insert(<u></u>ccccccccccccccccccccccc);<br>
>><br>
>> After:<br>
>>   SomeMap[std::pair(<u></u>aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert(<br>
>>       ccccccccccccccccccccccc);<br>
>><br>
>> This seems to be about 3:1 more common in Google and Chromium style and I<br>
>> found<br>
>> only a handful of instances inside the LLVM codebase.<br>
>><br>
>><br>
>> Without any significant numbers in the LLVM codebase, I would prefer<br>
>> LLVM's style stick to the first -- I think its significantly easier to read<br>
>> personally. I'd also be interested in others' opinions since we don't really<br>
>> have numbers here.<br>
>><br>
>><br>
>> Thanks for the additional input. There are less than 10 instances of<br>
>> either choice in the LLVM codebase providing a bad signal-to-noise ratio.<br>
>> This might mean that it doesn't matter much, but I am happy to switch this<br>
>> back for LLVM style if there is a general preference.<br>
>><br>
>><br>
>> Please. The second is much harder to read/scan and is a common pattern<br>
>> (largely without long lines I guess) in the backend.<br>
>><br>
>> -eric<br>
>><br>
>><br>
>><br>
>><br>
>> Modified:<br>
>>     cfe/trunk/lib/Format/<u></u>TokenAnnotator.cpp<br>
>>     cfe/trunk/unittests/Format/<u></u>FormatTest.cpp<br>
>><br>
>> Modified: cfe/trunk/lib/Format/<u></u>TokenAnnotator.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=198924&r1=198923&r2=198924&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/lib/Format/<u></u>TokenAnnotator.cpp?rev=198924&<u></u>r1=198923&r2=198924&view=diff</a><br>

>><br>
>> ==============================<u></u>==============================<u></u>==================<br>
>> --- cfe/trunk/lib/Format/<u></u>TokenAnnotator.cpp (original)<br>
>> +++ cfe/trunk/lib/Format/<u></u>TokenAnnotator.cpp Fri Jan 10 02:40:17 2014<br>
>> @@ -1203,7 +1203,7 @@ unsigned TokenAnnotator::splitPenalty(<u></u>co<br>
>>      return 2;<br>
>><br>
>>    if (Right.isMemberAccess()) {<br>
>> -    if (Left.isOneOf(tok::r_paren, tok::r_square) && Left.MatchingParen<br>
>> &&<br>
>> +    if (Left.is(tok::r_paren) && Left.MatchingParen &&<br>
>>          Left.MatchingParen-><u></u>ParameterCount > 0)<br>
>>        return 20; // Should be smaller than breaking at a nested comma.<br>
>>      return 150;<br>
>><br>
>> Modified: cfe/trunk/unittests/Format/<u></u>FormatTest.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=198924&r1=198923&r2=198924&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/cfe/trunk/unittests/<u></u>Format/FormatTest.cpp?rev=<u></u>198924&r1=198923&r2=198924&<u></u>view=diff</a><br>

>><br>
>> ==============================<u></u>==============================<u></u>==================<br>
>> --- cfe/trunk/unittests/Format/<u></u>FormatTest.cpp (original)<br>
>> +++ cfe/trunk/unittests/Format/<u></u>FormatTest.cpp Fri Jan 10 02:40:17 2014<br>
>> @@ -3910,8 +3910,8 @@ TEST_F(FormatTest, WrapsAtFunctionCallsI<br>
>><br>
>>    verifyFormat("EXPECT_CALL(<u></u>SomeObject, SomeFunction(Parameter))\n"<br>
>>                 "    .WillRepeatedly(Return(<u></u>SomeValue));");<br>
>> -  verifyFormat("SomeMap[std::<u></u>pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]\n"<br>
>> -               "    .insert(<u></u>ccccccccccccccccccccccc);");<br>
>> +  verifyFormat("SomeMap[std::<u></u>pair(aaaaaaaaaaaa,<br>
>> bbbbbbbbbbbbbbb)].insert(\n"<br>
>> +               "    ccccccccccccccccccccccc);");<br>
>>    verifyFormat("aaaaa(aaaaa(<u></u>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<u></u>aaa,\n"<br>
>>                 "<br>
>> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<u></u>aaa).aaaaa(aaaaa),\n"<br>
>>                 "      aaaaaaaaaaaaaaaaaaaaa);");<br>
>><br>
>><br>
>> ______________________________<u></u>_________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
>><br>
>><br>
><br>
</blockquote>