This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove unused #include "vec.h" from hash-table.h


On Wed, Sep 25, 2019 at 8:01 PM Christian Biesinger
<cbiesinger@google.com> wrote:
> On Mon, Sep 23, 2019 at 3:15 PM Jason Merrill <jason@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 <cbiesinger@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  <cbiesinger@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.

Curious, but I now think coretypes.h would be a better place; it
currently includes hash-table.h, and comes before common-target.h.

> It sounds like you're saying that in GCC, it's common and OK to rely
> on transitive includes for the classes you use?

In many cases, I think so.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]