<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 2:42 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Yes, but as I mentioned, two things are still unsupported due to limitations in clang-format.  They are return-type-on-new-line (only in declarations.  clang-format supports it for definitions) and the constructor initializer list comma at the end (clang-format puts it at the beginning).  <div class=""><br class=""></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">That said, the comma at the end of initializer list isn't documented on that page, and where we don't have a clearly documented rule, prefer the LLVM guidelines, so….<br class=""></div></div></div></blockquote><div><br class=""></div><div><div>That clang-format behavior seems weird to me, a quick scan through clang sources have the commas always at the end:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class="">  LabelDecl(DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II,</div><div style="margin: 0px; line-height: normal;" class="">            LabelStmt *S, SourceLocation StartL)</div><div style="margin: 0px; line-height: normal;" class="">    : NamedDecl(Label, DC, IdentL, II),</div><div style="margin: 0px; line-height: normal;" class="">      TheStmt(S),</div><div style="margin: 0px; line-height: normal;" class="">      MSAsmNameResolved(false),</div><div style="margin: 0px; line-height: normal;" class="">      LocStart(StartL) {}</div><div class=""><br class=""></div><div class="">etc.  I can’t remember seeing code in clang that does:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal;" class="">  LabelDecl(DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II,</div><div style="margin: 0px; line-height: normal;" class="">            LabelStmt *S, SourceLocation StartL)</div><div style="margin: 0px; line-height: normal;" class="">    : NamedDecl(Label, DC, IdentL, II)</div><div style="margin: 0px; line-height: normal;" class="">    , TheStmt(S)</div><div style="margin: 0px; line-height: normal;" class="">    , MSAsmNameResolved(false)</div><div style="margin: 0px; line-height: normal;" class="">    , LocStart(StartL) {}</div></div><div class=""><br class=""></div></div></div></div>That looks really weird, since you have to look past the noise of those commas to see what you really care about.  </div><div><br class=""></div><div>We do differ in that we tend to write this:</div><div><br class=""></div><div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class="">  LabelDecl(DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II,</div><div style="margin: 0px; line-height: normal;" class="">            LabelStmt *S, SourceLocation StartL) :</div><div style="margin: 0px; line-height: normal;" class="">      NamedDecl(Label, DC, IdentL, II),</div><div style="margin: 0px; line-height: normal;" class="">      TheStmt(S),</div><div style="margin: 0px; line-height: normal;" class="">      MSAsmNameResolved(false),</div><div style="margin: 0px; line-height: normal;" class="">      LocStart(StartL) {}</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div class="">with the colon at the end of the argument list.  I don’t think any of this behavior is prescribed one way or the other in the actual coding conventions…  Maybe there’s a bug in clang-format that if you put the : in the unexpected place the commas get moved to the wrong place as well?  But the llvm coding conventions make no prescription about this at all. I don’t think our code layout should be based on clang format bugs and all. We certainly shouldn’t do wholesale reformats that just make history harder to read for that reason.</div><div class=""><br class=""></div><div class="">Jim</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Dec 11, 2015 at 2:37 PM Todd Fiala <<a href="mailto:todd.fiala@gmail.com" class="">todd.fiala@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Okay, but does the format match the LLDB-modified format with some kind of configuration file?  We still need to match our guidelines here:<div class=""><br class=""></div><div class=""><a href="http://lldb.llvm.org/lldb-coding-conventions.html" style="font-size:13px" target="_blank" class="">http://lldb.llvm.org/lldb-coding-conventions.html</a><br class=""></div><div class=""><br class=""></div><div class="">We can achieve that with a config file for it, right?  (Maybe already existing, maybe in the lldb source tree already?)</div></div><div class="gmail_extra"></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Dec 11, 2015 at 2:35 PM, Zachary Turner <span dir="ltr" class=""><<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">With git you can already run "git clang-format".  You just need `git-clang-format` to be in your PATH (it's under llvm/tools/clang).  Not sure how to hook it into SVN</div><div class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Dec 11, 2015 at 2:32 PM Eugene Zelenko <<a href="mailto:eugene.zelenko@gmail.com" target="_blank" class="">eugene.zelenko@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At least clang-format should be applied to all newly added files before commit.<br class="">
<br class="">
Eugene.<br class="">
<br class="">
On Fri, Dec 11, 2015 at 2:30 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>> wrote:<br class="">
> Back on the topic of clang-format, what would it take to make clang-format a<br class="">
> regular part of peoples' workflows?<br class="">
><br class="">
> On Fri, Dec 11, 2015 at 2:27 PM Todd Fiala <<a href="mailto:todd.fiala@gmail.com" target="_blank" class="">todd.fiala@gmail.com</a>> wrote:<br class="">
>><br class="">
>> Yep - sorry.  I had been talking to Greg about this and misunderstood his<br class="">
>> comment on it. My mistake entirely.  Kate and I just talked and she pointed<br class="">
>> me to your document, Jim.<br class="">
>><br class="">
>> The description was:<br class="">
>> where we had a clearly adhered to standard, keep it.<br class="">
>> whee we didn't, we adopted LLVM.<br class="">
>><br class="">
>> Sorry for rehashing!<br class="">
>><br class="">
>> -Todd<br class="">
>><br class="">
>> On Fri, Dec 11, 2015 at 2:12 PM, Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank" class="">jingham@apple.com</a>> wrote:<br class="">
>>><br class="">
>>><br class="">
>>> On Dec 11, 2015, at 2:01 PM, Todd Fiala via lldb-commits<br class="">
>>> <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class="">
>>><br class="">
>>><br class="">
>>><br class="">
>>> On Fri, Dec 11, 2015 at 1:59 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>><br class="">
>>> wrote:<br class="">
>>>><br class="">
>>>> On Fri, Dec 11, 2015 at 1:55 PM Todd Fiala via lldb-commits<br class="">
>>>> <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class="">
>>>>><br class="">
>>>>> Hey Eugene and Greg,<br class="">
>>>>><br class="">
>>>>> I thought we were doing spaces before the open parens in places like<br class="">
>>>>> this:<br class="">
>>>>><br class="">
>>>>> -    BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine<br class="">
>>>>> (NULL,<br class="">
>>>>> ...<br class="">
>>>>> +    BreakpointResolverSP resolver_sp(new<br class="">
>>>>> BreakpointResolverFileLine(nullptr,<br class="">
>>>>><br class="">
>>>>> (see the removal of the space after BreakpointResolverFileLine from the<br class="">
>>>>> clang-tidy settings I presume).<br class="">
>>>>><br class="">
>>>>> Did I misunderstand that?<br class="">
>>>><br class="">
>>>><br class="">
>>>> This was officially removed from the coding standard some months ago,<br class="">
>>><br class="">
>>><br class="">
>>> Okay.  Are we 100% in sync with LLVM coding standard guidelines?  If so I<br class="">
>>> can just look there to see what we're supposed to be doing.<br class="">
>>><br class="">
>>><br class="">
>>> No, the differences between the lldb and llvm coding standards are<br class="">
>>> documented in:<br class="">
>>><br class="">
>>> <a href="http://lldb.llvm.org/lldb-coding-conventions.html" rel="noreferrer" target="_blank" class="">http://lldb.llvm.org/lldb-coding-conventions.html</a><br class="">
>>><br class="">
>>> Jim<br class="">
>>><br class="">
>>><br class="">
>>>><br class="">
>>>> but not everyone has adopted this unfortunately.  See r228860.  It pains<br class="">
>>>> me to no end that we differ from LLVM, because it leads to exactly these<br class="">
>>>> type of problems where people aren't sure what the exact set of rules are.<br class="">
>>><br class="">
>>><br class="">
>>><br class="">
>>><br class="">
>>> --<br class="">
>>> -Todd<br class="">
>>> _______________________________________________<br class="">
>>> lldb-commits mailing list<br class="">
>>> <a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a><br class="">
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br class="">
>>><br class="">
>>><br class="">
>><br class="">
>><br class="">
>><br class="">
>> --<br class="">
>> -Todd<br class="">
</blockquote></div>
</div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div></div><div class="gmail_extra">-- <br class=""><div class=""><div dir="ltr" class="">-Todd</div></div>
</div></blockquote></div></div></div>
</div></blockquote></div><br class=""></body></html>