[C++ PATCH] give builtin types consistent name
Nathan Sidwell
nathan@acm.org
Wed Oct 4 17:53:00 GMT 2017
The builtin type machinery is one of the places were we push decls into
:: under not-their-name.
There's no real reason for this, and the fix is simple -- create a new
TYPE_DECL if we use a name from the ridpointer table. I took the
opportunity of reordering record_builtin_type, which was a series of
interleaved conditionals dealing with different things.
I add an assert to set_global_binding that the given name is DECL_NAME.
Of course this raises the opportunity of just making set_global_binding
have a single arg, like pushdecl and friends. And then the two macros
IDENTIFIER_GLOBAL_VALUE and SET_IDENTIFIER_GLOBAL_VALUE could be
dispensed with and we have simply
tree get_global_value (tree identifier);
tree set_global_value (tree decl);
perhaps 's/value/decl/'?
Jason, any preference?
set_global_value has to do the stat_hack dance, I can't recall the case
where it happens, but I recall it biting me when I tried to dispense
with it.
The remaining mismatched name case is the anonymous namespace. Once
that's fixed we can change namespace bindings from a map to a hash, and
halve its size.
Applying to trunk.
nathan
--
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bltn.diff
Type: text/x-patch
Size: 3312 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171004/e97c8c28/attachment.bin>
More information about the Gcc-patches
mailing list