<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 2, 2020 at 9:57 AM Michael Kruse via flang-dev <<a href="mailto:flang-dev@lists.llvm.org">flang-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Thank you for the summary. Some more things to consider:<br>
<br>
Other than the clang-format file, there are other code style<br>
differences not covered by clang-format. For instance, the naming<br>
scheme for local variables. LLVM uses PascalCase, but lld uses<br>
camelCase (although there were discussion to change this for LLVM as<br>
well).<br></blockquote><div><br></div><div>MLIR also use camelCase, mostly because we tried to anticipate where the wind was going on this and since lld was getting renamed at the time... It didn't pan out in LLVM so far unfortunately.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
<br>
Am Mo., 2. März 2020 um 09:08 Uhr schrieb David Truby via flang-dev<br>
<<a href="mailto:flang-dev@lists.llvm.org" target="_blank">flang-dev@lists.llvm.org</a>>:<br>
> Tim Keith and Peter Klausler from Nvidia replied to say that comment alignment (and code alignment in general) cause spurious changes to a appear when submitting diffs, making it more difficult to see what has changed. Tim Keith also pointed out that clang and llvm are not properly clang-formatted entirely themselves, which weakens the “common code style across the board” desire.<br>
<br>
LLVM does not re-format code on a global scale. Large formatting-only<br>
changes are not done (also see <a href="https://reviews.llvm.org/D50055" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50055</a>).<br></blockquote><div><br></div><div>In general this is correct, in practice lldb and lld both got a one-time large scale renaming/formatting I believe.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Otherwise a change of clang-format would require re-formatting of the<br>
entire code base.<br>
<br>
Only changed lines in patches are re-formatted, e.g. with 'git<br>
clang-format'. There should not be spurious changes in submitted<br>
diffs.<br>
<br>
As far as I see, this is the only argument against a vanilla<br>
'BasedOnStyle: LLVM'?<br>
<br>
<br>
> Eric Schweitz replied to show MLIR’s clang-format file, which is also the one used for the lib/Lower subdirectory of f18. This style has only one small change from the LLVM style, but it is nonetheless a diversion. Eric also pointed out that clang-formatting for new code is enforced on Phabricator by pre-commit bots. This is the case not only for mlir, but for new code heading to clang and llvm too. This is consistent with the Coding Guidelines which do not require that all code is properly clang-formatted, only all new code. Eric also suggested that we could submit diffs without running clang-format, so that the changes are clear, and then once approved run clang-format to match the code with the rest of the project. This might mitigate the code alignment issues.<br>
<br>
Is there a reason why MLIR added 'AlwaysBreakTemplateDeclarations:<br>
Yes'? I'd prefer to not deviate from any LLVM standards/policy unless<br>
there is a project-specific reason. If the reason is not<br>
project-specific, it should be discussed for the entire LLVM project.<br></blockquote><div><br></div><div>I don't know, but I agree. This got merged unnoticed, otherwise I'd have removed it when merging MLIR into LLVM (or before). I just sent <a href="https://llvm.discourse.group/t/remove-mlir-custom-clang-format-configuration/647">https://llvm.discourse.group/t/remove-mlir-custom-clang-format-configuration/647</a> FYI.</div><div><br></div><div>Thanks,</div><div><br></div><div>-- </div><div>Mehdi</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Not there is another current thread about deviating from the general<br>
LLVM policy: <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-February/139381.html" rel="noreferrer" target="_blank">https://lists.llvm.org/pipermail/llvm-dev/2020-February/139381.html</a><br>
<br>
Michael<br>
_______________________________________________<br>
flang-dev mailing list<br>
<a href="mailto:flang-dev@lists.llvm.org" target="_blank">flang-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev</a><br>
</blockquote></div></div></div>