On Mon, Sep 23, 2019 at 3:15 PM Jason Merrill <ja...@redhat.com> wrote: > > On Mon, Sep 23, 2019 at 3:52 PM Christian Biesinger via gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > From: Christian Biesinger <cbiesin...@chromium.org> > > > > Removes an unused include as a cleanup. Requires updating > > lots of files who previously relied on this transitive include. > > > > I have only been able to test this on x86_64 because I failed > > at building a cross compiler. > > > > gcc/ChangeLog: > > > > 2019-09-23 Christian Biesinger <cbiesin...@chromium.org> > > > > * bitmap.c: Include vec.h. > > * common/common-target.h: Likewise. > > * common/common-targhooks.h: Likewise. > > * config/aarch64/aarch64-protos.h: Likewise. > > * config/aarch64/aarch64.c: Likewise. > > * config/aarch64/cortex-a57-fma-steering.c: Likewise. > > * config/arc/arc.c: Likewise. > > * config/avr/avr-c.c: Likewise. > > * config/c6x/c6x.c: Likewise. > > * config/cris/cris.c: Likewise. > > * config/darwin.c: Likewise. > > * config/epiphany/resolve-sw-modes.c: Likewise. > > * config/i386/i386-features.c: Likewise. > > * config/i386/i386.c: Likewise. > > * config/ia64/ia64.c: Likewise. > > * config/mips/mips.c: Likewise. > > * config/mn10300/mn10300.c: Likewise. > > * config/nds32/nds32-relax-opt.c: Likewise. > > * config/nds32/nds32.c: Likewise. > > * config/nvptx/nvptx.c: Likewise. > > * config/pa/pa.c: Likewise. > > * config/pdp11/pdp11.c: Likewise. > > * config/rs6000/rs6000-c.c: Likewise. > > * config/rx/rx.c: Likewise. > > * config/s390/s390-c.c: Likewise. > > * config/s390/s390.c: Likewise. > > * config/sparc/sparc.c: Likewise. > > * config/visium/visium.c: Likewise. > > * config/vms/vms.c: Likewise. > > * config/vxworks.c: Likewise. > > * dbgcnt.c: Likewise. > > * diagnostic-show-locus.c: Likewise. > > * edit-context.c: Likewise. > > * fibonacci_heap.h: Likewise. > > * function.h: Likewise. > > * genmatch.c: Likewise. > > * ggc-common.c: Likewise. > > * graphds.h: Likewise. > > * hash-table.h: Remove unused include of vec.h. > > * input.c: Include vec.h. > > * json.h: Likewise. > > * opt-suggestions.h: Likewise. > > * opts.h: Likewise. > > * rtl.h: Likewise. > > * target.h: Likewise. > > * timevar.c: Likewise. > > * tree-core.h: Likewise. > > * typed-splay-tree.c: Likewise. > > * vec.c: Likewise. > > * vector-builder.h: Likewise. > > * vtable-verify.h: Likewise. > > This is a surprising list of files. For instance, common-target.h > uses nothing from vec.h, and most of these files include tree-core.h, > so adding the include there should avoid the need in most other files.
I did add it to tree-core.h, but it did not help. (Note: I added it to the files in config/ without verifying if it is strictly needed, because I couldn't try compiling most of them; they do all use vec<> or auto_vec<>. However, all the other files did need the include) I added it to common-target.h because of: n file included from ../../gcc/gcc/params.c:24: ../../gcc/gcc/common/common-target.def:98:2: error: ‘vec’ does not name a type vec<const char *>, (int option_code, const char *prefix), ^~~ ../../gcc/gcc/common/common-target.h:62:48: note: in definition of macro ‘DEFHOOK’ #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS; ^~~~ Including it in common-target.def doesn't seem to work; I'm not entirely sure why. It sounds like you're saying that in GCC, it's common and OK to rely on transitive includes for the classes you use? Bernhard: Thanks, I will look into that Segher: reduce-headers seems to not work for header files, or maybe I used it wrong. (it couldn't find the output file for hash-table.h) Thanks, Christian