The last time we evaluated this behavior was in r311904, which had this
message:
S_UDT symbols are the debugger's "index" for all the structs, typedefs, classes, and enums in a program. If any of those structs/classes don't have a complete declaration, or if there is a typedef to something that doesn't have a complete definition, then emitting the S_UDT is unhelpful because it doesn't give the debugger enough information to do anything useful. On the other hand, it results in a huge size blow-up in the resulting PDB, which is exacerbated by an order of magnitude when linking with /DEBUG:FASTLINK. With this patch, we drop S_UDT records for types that refer either directly or indirectly (e.g. through a typedef, pointer, etc) to a class/struct/union/enum without a complete definition. This brings us about 50% of the way towards parity with /DEBUG:FASTLINK PDBs generated from cl-compiled object files.
This modifies LLVM so that we only discard S_UDTs pointing directly to
incomplete types, but keep S_UDTs that indirectly use incomplete types,
as in the following C++ fragment:
struct Opaque; typedef Opaque *OpaqueHandle; OpaqueHandle gv;
If we don't emit the OpaqueHandle typedef in this TU, it's possible that
no TU will emit the typedef. On the other hand, this could considerably
increase object file size, so we should keep an eye on that.
Is this sufficient? If T->isForwardDecl() is true, does that mean the debug info does not contain a full decl at all?