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