Currently calling SBType::IsTypeComplete returns true for record types
if and only if the underlying record in our internal Clang AST has a definition.
The function however doesn't actually force the loading of any external
definition from debug info, so it currently can return false even if the
type is actually defined in a program's debug info but LLDB hasn't lazily
created the definition yet.
This patch changes the behaviour to always load the definition first
so that IsTypeComplete now consistently returns true if there is a
definition in the module/target.
The motivation for this patch is twofold:
- The API is now arguably more useful for the user which don't know or
care about the internal lazy loading mechanism of LLDB.
- With D101950 there is no longer a good way to ask a Decl for a definition
without automatically pulling in a definition from the ExternalASTSource. The
current behaviour doesn't seem useful enough to justify the necessary workarounds
to preserve it for a time after D101950.
Note that there was a test that used this API to test lazy loading of debug info
but that has been replaced with TestLazyLoading by now (which just dumps the
internal Clang AST state instead).
Thanks for adding this!