On Mon, 4 Jan 2021 23:39:18 GMT, Jie Fu <ji...@openjdk.org> wrote: >> src/hotspot/share/compiler/compiler_globals.hpp line 29: >> >>> 27: >>> 28: #include "compiler/compiler_globals_pd.hpp" >>> 29: #ifdef COMPILER1 >> >> `#include "runtime/globals_shared.hpp"` should not be removed. >> compiler_globals.hpp uses the `DECLARE_FLAGS` macro, which is defined by >> globals_shared.hpp. > >> `#include "runtime/globals_shared.hpp"` should not be removed. >> compiler_globals.hpp uses the `DECLARE_FLAGS` macro, which is defined by >> globals_shared.hpp. > > Since globals_shared.hpp is included in compiler_globals_pd.hpp, I think it's > fine to remove it.
We should not rely on indirect inclusion. Otherwise, compiler_globals.hpp will break if compiler_globals_pd.hpp is changed to not include globals_shared.hpp. In fact, I have been fixing a lot of such problems when restructuring the header files. See https://github.com/openjdk/jdk/pull/1610 -- the vast majority of the 59 files changed in that PR were caused by relying on indirect inclusion of stubRoutines.hpp. ------------- PR: https://git.openjdk.java.net/jdk/pull/1894