On Fri, May 24, 2019 at 10:34 AM Nathan Sidwell <nat...@acm.org> wrote: > > Currently gcc/tree.c exports an anonymous name format string, and a > predicate to detect identifiers of that form. The C++ and D FEs use > those functions to create and check anonymous names. > > That seems a little duplicative. This patch changes tree.c to export an > anonymous name generator, and uses a spare bit in IDENTIFIERs to mark > them as anonymous, so no more strcmp to distinguish them. Then replaces > the bespoke handling in the two front ends to use the new interface. > > While my original goal was to make there be only one anon-identifier in > the C++ FE (because modules kind of would prefer not to have names > depend on source ordering), I didn't get to that goal, I think we still > sometimes place them in symbol tables. But this still seems a good thing. > > Are the common and D pieces ok? > > Jason, lambda class names are similarly anonymous, and I have a patch > for them too. Would you prefer they just be from the same set of > identifiers, with another C++-specific flag bit, or have a somewhat more > distinct name, as they do now? (I.e. do you want to be able to > distinguish lambdas when debugging just by looking at the string?)
I don't have a strong opinion. It can be useful to recognize them that way, but I don't imagine I'd miss it too much. Jason