ir: Make pointers name stable wrt decl-only-ness of pointed-to types
When emitting the pretty representation of pointers from the IR, it
can so happen that the pointed type is a decl-only type which has been
resolved to a definition. In that case, the decl-only type might be
anonymous while the definition has a naming typedef, effectively
giving it a name. Then, using the decl-only type to construct the
name of the type might yield a different type name, more precisely,
the internal "anonymous" name of that type. This can lead to several
types having the same anonymous name, leading to instability with
respect to sorting.
The patch just looks through the decl-only pointed-to types before
using their name to construct the name of the pointer type. The patch
does that for reference types as well.
* src/abg-ir.cc (look_through_decl_only): New overload for
type_base.
* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Adjust.