Original description (https://reviews.llvm/org/D69924)
Without this change, when a nested tag type of any kind (enum, class,
struct, union) is used as a variable type, it is emitted without
emitting the parent type. In CodeView, parent types point to their inner
types, and inner types do not point back to their parents. We already
walk over all of the parent scopes to build the fully qualified name.
This change simply requests their type indices as we go along to enusre
they are all emitted.
Now, while walking over the parent scopes, check whether the type is already
in the process of being emitted before requesting its type index, to avoid
trying to record the same type index twice.
Fixes PR43905
Can you add a test that fails if this check is removed? You should be able to reduce one out of the crash bug Hans filed.