On September 21, 2019 12:28:57 PM GMT+02:00, Christian Biesinger <cbiesin...@google.com> wrote: >On Sat, Sep 21, 2019 at 7:22 PM Richard Biener ><richard.guent...@gmail.com> wrote: >> >> On September 21, 2019 11:12:38 AM GMT+02:00, Christian Biesinger via >gcc-patches <gcc-patches@gcc.gnu.org> wrote: >> >Hello, >> > >> >I would like to move hash-table.h, hash-map.h and related files >> >to libiberty, so that GDB can make use of it. >> > >> >I see that gcc already has a C++ file in include/ (unique-ptr.h), >> >which I understand is libiberty. >> > >> >However, this patch is not complete yet (for a start, it doesn't >> >compile). Before I go further down this road, is this acceptable >> >in principle to the gcc/libiberty maintainers? >> > >> >(the bulk of the patch is including vec.h in a lot of files, >> >because hash-table.h previously included it. It doesn't >> >actually use it, and I didn't think it was necessary to >> >move that to libiberty as well, so I removed that include >> >and instead am adding it to all the files that now don't >> >compile.) >> >> The bulk seems to be hash_table to hash_table_ggc renaming. Can you >explain? > >Yeah, sure. If hash-table.h lives in libiberty, I wanted to reduce the >dependencies on other headers. GCC's garbage collector seems like >something that does not belong there, so I moved this create function >to a separate header, which required renaming it since it now can't be >part of the same class. (the other option would be some kind of #ifdef >GCC thing, but that seemed ugly to me)
As long as gengtype can still pick up everything correctly via the GTY annotations that's probably OK. >> Also we can then rename create_ggc back to create? > >Sure, that'd work. > >Christian