+1 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.
Jim > On Feb 23, 2016, at 3:27 AM, Pavel Labath via lldb-commits > <lldb-commits@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@lists.llvm.org> wrote: >> On Mon, Feb 22, 2016 at 4:14 PM, Adrian McCarthy <amcca...@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. >>> >>> http://llvm.org/docs/CodingStandards.html#include-style >>> >>> I know LLDB doesn't always follow LLVM guidelines, but this seems pretty >>> common and intentional. >> >> I try to follow headers section comments. >> >> Eugene. >> _______________________________________________ >> lldb-commits mailing list >> lldb-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > _______________________________________________ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits