[Lldb-commits] [lldb] r261593 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectCommands.cpp; other minor fixes.
Jim Ingham via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 23 10:36:47 PST 2016
We put the header file first immediately after the header comment in the .cpp file. The reason is that if you put the .cpp file's associated .h file in the project include headers section, then it would be easy to accidentally put another "project include" in front of the associated one (for instance because you are also supposed to arrange them alphabetically.) The llvm coding conventions also say putting prominently first is for documentation purposes - showing where to find the interface for this .cpp file, which is a little harder to see if buried in the project includes.
> On Feb 23, 2016, at 3:27 AM, Pavel Labath via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> I agree with Adrian. I don't think the section comments are supposed
> to apply to the "main header file", which should always come first.
> On 23 February 2016 at 00:17, Eugene Zelenko via lldb-commits
> <lldb-commits at lists.llvm.org> wrote:
>> On Mon, Feb 22, 2016 at 4:14 PM, Adrian McCarthy <amccarth at google.com> wrote:
>>> It looks like this patch reorders the #includes in a way that seems contrary
>>> to general practice. In particular, if foo.cpp has a header foo.h, then it
>>> should include foo.h before any other files. This helps ensure that foo.h
>>> can stand alone and won't require clients to have to figure out what else
>>> must be included.
>>> I know LLDB doesn't always follow LLVM guidelines, but this seems pretty
>>> common and intentional.
>> I try to follow headers section comments.
>> lldb-commits mailing list
>> lldb-commits at lists.llvm.org
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
More information about the lldb-commits