6348631 - request for review (updated)
David Holmes
David.Holmes at oracle.com
Thu Dec 2 19:10:27 PST 2010
Y. S. Ramakrishna said the following on 12/03/10 03:10:
> On 12/02/10 02:22, Volker Simonis wrote:
>> As far as I remember, the rule of thumb (as detailed in
>> includeDB_core) was:
>> - put declarations into .hpp
>> - put definitions of inline functions into .inline.hpp
>> - .hpp files only include other .hpp files
>> - every xxx.inline.hpp includes the corresponding xxx.hpp
Seems the wrong way round to me but let's move on.
>> - every yyy.cpp includes xxx.inline.hpp if it requires definitions
>> from it or just xxx.hpp if it only needs the declarations
Again sounds "wrong" as the cpp has to know is inline and what isn't and
that isn't its business. cpp should include hpp should include
inline.hpp. But again lets move on.
>> Now after we have no includeDB anymore I would also advocate for the
>> inclusion of system headers where they are needed. So if
>> xxx.inline.hpp requires a declaration from zzz.h, it should include
>> it. Otherwise the users of xxx.inline.hpp (i.e. every file which
>> includes xxx.inline.hpp) would have to manually include zzz.h BEFORE
>> including xxx.inline.hpp which is not obvious.
>>
>> As mentioned by Ivan, another nice benefit of this approach is that if
>> xxx.inline.hpp will be in the precompiled header file, so will be the
>> system headers like zzz.h. This will speed up compilation compared to
>> the case where zzz.h would be directly included into the .cpp file.
>
> I agree. This sounds like the right approach, and one that is consistent
> with past practice. This would also be exactly what the
> make-deps removal accomplished for the existing .inline.hpp dependencies as
> well.
So just to be clear here, Volker and Ramki agree with me that the system
includes should remain in the header files that need them - right?
Whereas Ivan and Coleen want to see them moved into the cpp files.
David
More information about the hotspot-dev
mailing list