[llvm-dev] LLVM coding standards and order of includes

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 10 09:03:00 PDT 2015


Like David says, if it's not part of LLVM, the LLVM coding style doesn't
really apply.

However, I would consider any header that is not part of your own project,
and not part of LLVM as "system" - whether it REALLY is a system header, or
part of some package you've installed on the system to support your
development is probably not really relevant.

--
Mats

On 10 September 2015 at 16:33, David Blaikie via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> On Thu, Sep 10, 2015 at 8:06 AM, Russell Wallace via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> According to the LLVM coding standards,
>>
>> Immediately after the header file comment
>> <http://llvm.org/docs/CodingStandards.html#header-file-comment> (and
>> include guards if working on a header file), the minimal list of
>> #includes
>> <http://llvm.org/docs/CodingStandards.html#minimal-list-of-includes>required
>> by the file should be listed. We prefer these #includes to be listed in
>> this order:
>>
>>    1. Main Module Header
>>    2. Local/Private Headers
>>    3. llvm/...
>>    4. System #includes
>>
>> If a program is using LLVM, and also using a third-party library such as
>> GMP, where would the coding standard have the GMP include be placed
>> relative to the above order?
>>
>
> The LLVM coding conventions are really intended for LLVM's code itself,
> they probably don't cover many situations that would arise when using LLVM
> code in broader applications like this... (nor is it likely we'd want to
> add wording to the style guide to clarify those use cases, unfortunately).
>
> That said, we do have one (zlib compression?) or two (maybe md5 too?)
> external libraries used in LLVM, I imagine they get bundled in with the
> system includes, but I've not looked (& given that there aren't many, they
> might not be done in any consistent/deliberate manner)
>
> - Dave
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150910/0def0c4d/attachment.html>


More information about the llvm-dev mailing list