When ::get_qualified_name() is invoked for some types, the value is
cached for performance reasons.
One thing to keep in mind is that the structure of a type can change
between the time when the type is first built and the time when it's
canonicalized. This is because the type can be built progressively,
with sub-types being added over time until the type is fully built.
Then it can be canonicalized.
So if ::get_qualified_name is invoked on a non-canonicalized type and
the result is cached, then that result might not reflect the state of
the type *after* its canonicalized. So the cached value might be
wrong.
To address that issue, the solution is to *not* cache the result of
::get_qualified_name() until the type is canonicalized. After the
type is canonicalized and so we know the structur of the type won't
change, then the result of ::get_qualified_name is cached.
And this is what this patch does for qualified, pointer and array
types.
Note that the necessary update to the regression test suite is not
provided with this patch. It's provided by a separate patch at the
end of the current series of patches.
* src/abg-ir.cc ({qualified, pointer,
array}_type_def::get_qualified_name): Don't cache internal and
non-internal qualified name when the type is not canonicalized.