<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 20, 2015 at 4:22 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-Nov-20, at 13:01, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
><br>
><br>
><br>
> On Fri, Nov 20, 2015 at 11:43 AM, Duncan P. N. Exon Smith via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> > On 2015-Nov-19, at 14:11, Alexey Samsonov via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> ><br>
> > Author: samsonov<br>
> > Date: Thu Nov 19 16:11:10 2015<br>
> > New Revision: 253608<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=253608&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=253608&view=rev</a><br>
> > Log:<br>
> > Tell clang-format that (most) sanitizers are written using Google style guide.<br>
><br>
> I'm guessing this isn't a change of policy, but I didn't know about it.<br>
> Why don't they use the LLVM style?<br>
><br>
> Because they were initially developed outside of the llvm tree, we were not even sure the code will be ever accepted.<br>
><br>
>   Is that documented in the coding<br>
> standards?<br>
> no<br>
> Should it be?<br>
><br>
> I don't think so.<br>
> I believe the coding style already tells to use whatever style is in use in a given file.<br>
><br>
<br>
</span>But it says that all new files should use LLVM style, and we<br>
generally expect to migrate files over time to use LLVM style.<br></blockquote><div><br></div><div>I've committed .clang-format only to several subdirectories of compiler-rt/lib (so stuff like builtins, profile etc.)</div><div>is not affected.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This change would make all new files use the Google style.<br></blockquote><div><br></div><div>That's probably fine: when the new file is created it's often the case that 90%</div><div>if its contents are moved from existing file - we do split and merge files and move the code around</div><div>somewhat frequently. It would be pain to re-format the piece of code when it's moved.</div><div><br></div><div>Mixing of styles is already somewhat confusing in UBSan, which is written in LLVM style, but uses functionality</div><div>from sanitizer_common written in Google style. I would like to see less of this happening.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I guess I'm also wondering whether this is something we should<br>
accept generally for big patches that are originally developed<br>
out of tree.  Were the sanitizers a special exception, or is<br>
this how we do things now?<br>
<br>
I know LLDB and libc++ also have their own coding styles, so<br>
this isn't exactly the first precedent, but this is still kind<br>
of surprising to me (as I guess I mistakenly thought that<br>
llvm.git, clang.git, clang-tools-extra.git, and compiler_rt.git<br>
were in general agreement).<br></blockquote><div><br></div><div>There's a dark corner of the compiler-rt you were not aware of, and will not be happy to</div><div>learn about (we hate it as well) - we actually have a script which enforces Google coding style</div><div>(not just whitespaces) at test-time and it's been around since day1 of sanitizers in compiler-rt. My change</div><div>kind of keeps the status-quo and makes its harder for clang-format user to accidentally make the</div><div>script unhappy about the code modified.</div><div><br></div><div>So I don't think compiler-rt was "in agreement" there.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
><br>
> ><br>
> > Added:<br>
> >    compiler-rt/trunk/lib/asan/.clang-format<br>
> >    compiler-rt/trunk/lib/dfsan/.clang-format<br>
> >    compiler-rt/trunk/lib/interception/.clang-format<br>
> >    compiler-rt/trunk/lib/lsan/.clang-format<br>
> >    compiler-rt/trunk/lib/msan/.clang-format<br>
> >    compiler-rt/trunk/lib/safestack/.clang-format<br>
> >    compiler-rt/trunk/lib/sanitizer_common/.clang-format<br>
> >    compiler-rt/trunk/lib/tsan/.clang-format<br>
> ><br>
> > Added: compiler-rt/trunk/lib/asan/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/asan/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/asan/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/dfsan/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/dfsan/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/dfsan/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/interception/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/interception/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/interception/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/lsan/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/lsan/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/lsan/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/msan/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/msan/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/msan/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/safestack/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/safestack/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/safestack/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/safestack/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/safestack/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/sanitizer_common/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/sanitizer_common/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/sanitizer_common/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> > Added: compiler-rt/trunk/lib/tsan/.clang-format<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/.clang-format?rev=253608&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/.clang-format?rev=253608&view=auto</a><br>
> > ==============================================================================<br>
> > --- compiler-rt/trunk/lib/tsan/.clang-format (added)<br>
> > +++ compiler-rt/trunk/lib/tsan/.clang-format Thu Nov 19 16:11:10 2015<br>
> > @@ -0,0 +1 @@<br>
> > +BasedOnStyle: Google<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>