[llvm-commits] [PATCH] Simplify the #include ordering rules of the coding standards

Eli Bendersky eliben at google.com
Fri Nov 30 08:40:34 PST 2012


>
> I've done a fair amount of moving headers around to fix layering issues, and I am continually frustrated by the fact that most of the #include sections of files in LLVM (and Clang to a lesser degree) do not actually follow the coding standards strictly. But honestly, that's because the coding standards are really hard to follow with a somewhat unexplained sequencing in the middle.
>
> This will become especially confusing when I begin moving headers from the top level tree in LLVM into an 'IR' subdirectory.
>
> I propose to simplify the rules: just lump all the 'llvm' headers that aren't treated specially into one group, and run your editor's 'sort' command over them.
>
> Thoughts?
> -Chandler
>
> http://llvm-reviews.chandlerc.com/D147
>
> Files:
>   docs/CodingStandards.rst
>
> Index: docs/CodingStandards.rst
> ===================================================================
> --- docs/CodingStandards.rst
> +++ docs/CodingStandards.rst
> @@ -284,17 +284,10 @@
>
>  #. Main Module Header
>  #. Local/Private Headers
> -#. ``llvm/*``
> -#. ``llvm/Analysis/*``
> -#. ``llvm/Assembly/*``
> -#. ``llvm/Bitcode/*``
> -#. ``llvm/CodeGen/*``
> -#. ...
> -#. ``llvm/Support/*``
> -#. ``llvm/Config/*``
> +#. ``llvm/...``
>  #. System ``#include``\s
>
> -and each category should be sorted by name.
> +and each category should be sorted lexicographically by the full path.
>

sgtm




More information about the llvm-commits mailing list