The recent patch that reordered parsed attributes made it clear
that the diagnostics when printing attributes were incredibly
inconsistent. in the mutual-exclusion case, the order of the
attributes would change which was printed with leading/trailing
underscores.
This is because GNU attributes are permitted to be spelled with
leading/trailing underscores, but are quickly normalized after
parsing. Therefore, any attribute that had been converted to a
Attr type would only have the non-underscored type.
This patch adds a diagnostic category for a quoted-std-string,
as well as overloads for operator<< to permit ParsedAttr to be
sent to be emitted directly.
THEN, this patch changes everywhere that we were doing PA.getName()
in a diagnostic (which got the IdentifierInfo, which hadn't been
normalized) and replaces it with a call to the new operator<<.
The result is that ALL attributes are now uniformly printed with
the normalized name, rather than a mix of names.
Note that the pointer-overload is required since a couple of templates are used that switch between an Attr and a ParsedAttr, so we need to have the same form as the Attr.
Also note that we cannot do what Attr does (which is store an Attr Pointer in the diagnostic) without making Basic dependent on Sema, which seemed worse than the allocation in diagnostic situations.