This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Sam van Kampen <sam@segfault.party>, Martin Sebor <msebor at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Nov 2019 15:46:23 +0100
- Subject: Re: [patch, c++] Add a warning flag for the enum bit-field declaration warning in bug #61414.
- References: <20171016111842.zmajbbopy2wkrzjz@segfault.party> <20171016123727.anxuxjzna3be3zyy@segfault.party> <35949158-4c52-207d-d962-adc988fd5310@gmail.com> <20171018135549.lkgo3xt6t7jacnqh@segfault.party> <f0f3ece2-b213-ff33-9b26-d283fcbf90c9@gmail.com> <20171018191516.h5ewt3z6wsvgauvs@segfault.party> <CADzB+2=m3fZrg7kp1B77M6MiJeReBkUwsUyakUs7xNUBMUJDjg@mail.gmail.com> <20191125143932.GA10088@tucnak>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 25, 2019 at 03:39:32PM +0100, Jakub Jelinek wrote:
> I guess the question is, shall we store the minimum precision needed
> somewhere by finish_enum_value_list (perhaps only bother if the precision
> of the underlying type is not the same) or compute it each time again
> (which would mean for each bitfield of enum type walk the list of all the
> enum values)? And, if we should store it somewhere, any preferences where?
> These days C++ FE has TYPE_LANG_SPECIFIC just for classes, so options are
> just use the class TYPE_LANG_SPECIFIC and just stick the min/max values in
> some trees in there, restore having different lang specific variants and
> store just minimum precision in there, add hash map from tree (hashed using
> TYPE_UID) to precision, something else?
Or yet another possibility, only compute it on demand and use a hash map as
cache.
Jakub