[cfe-dev] Coding Style

via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 26 04:58:54 PDT 2019


To put it yet another way:
We want new/modified code to conform to the style enforced by clang-format.  We have not applied that format to all existing code.  LLVM's coding style has evolved over the years, and the general feeling within the project is that a mass conversion from old to new style would be too disruptive.  So, you will find a mix of styles within the project, although it's not too common to find a mix of styles within the same file.
For patches you might be writing, there are a couple of useful scripts in clang/tools/clang-format, which are clang-format-diff.py and git-clang-format.
--paulr

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Hubert Tong via cfe-dev
Sent: Tuesday, June 25, 2019 11:34 PM
To: Pardis Pashakhanloo
Cc: Clang Dev
Subject: Re: [cfe-dev] Coding Style

On Tue, Jun 25, 2019 at 11:12 PM Pardis Pashakhanloo via cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>> wrote:
Hi all,

What is the coding style that clang developers (https://github.com/llvm-mirror/clang) use? When I use ".clang-format" to reformat the code that is in this repo, cpp files change. Is there any other clang-format config that is used in this repo?
That the code does not change when `clang-format` is applied using the LLVM style (`--style=llvm`) is not an actual requirement the last I checked. Put another way, `clang-format` output is not the only valid expression of the LLVM style. Instead of applying `clang-format` to the entire file, try using `clang/tools/clang-format/git-clang-format`.


Best,
Pardis
_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190626/1691bb33/attachment.html>


More information about the cfe-dev mailing list