llvm-project/llvm/test/DebugInfo
Zachary Turner 37c747498d [CodeView] Don't output S_UDTs for nested typedefs.
S_UDT records are basically the "bridge" between the debugger's
expression evaluator and the type information. If you type
(Foo*)nullptr into the watch window, the debugger looks for an
S_UDT record named Foo. If it can find one, it displays your type.
Otherwise you get an error.

We have always understood this to mean that if you have code like
this:

  struct A {
    int X;
  };

  struct B {
    typedef A AT;
    AT Member;
  };

that you will get 3 S_UDT records. "A", "B", and "B::AT". Because
if you were to type (B::AT*)nullptr into the debugger, it would
need to find an S_UDT record named "B::AT".

But "B::AT" is actually the S_UDT record that would be generated
if B were a namespace, not a struct. So the debugger needs to be
able to distinguish this case. So what it does is:

  1. Look for an S_UDT named "B::AT". If it finds one, it knows
     that AT is in a namespace.
  2. If it doesn't find one, split at the scope resolution operator,
     and look for an S_UDT named B. If it finds one, look up the type
     for B, and then look for AT as one of its members.

With this algorithm, S_UDT records for nested typedefs are not just
unnecessary, but actually wrong!

The results of implementing this in clang are dramatic. It cuts
our /DEBUG:FASTLINK PDB sizes by more than 50%, and we go from
being ~20% larger than MSVC PDBs on average, to ~40% smaller.

It also slightly speeds up link time. We get about 10% faster
links than without this patch.

Differential Revision: https://reviews.llvm.org/D37410

llvm-svn: 312583
2017-09-05 22:06:39 +00:00
..
AArch64 Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
AMDGPU Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
ARM SelectionDAG: Emit correct debug info for multi-register function arguments. 2017-08-30 20:51:20 +00:00
COFF [CodeView] Don't output S_UDTs for nested typedefs. 2017-09-05 22:06:39 +00:00
Generic Don't add a fragment expression when GlobalSRA splits up a single-member struct 2017-08-31 00:06:18 +00:00
Inputs Revert "[Decompression] Fail gracefully when out of memory" 2017-09-05 22:04:00 +00:00
Lanai
MIR Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
MSP430 Parse and print DIExpressions inline to ease IR and MIR testing 2017-08-23 20:31:27 +00:00
Mips Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
PDB [llvm-pdbutil] Print detailed S_UDT stats. 2017-08-31 20:43:22 +00:00
PowerPC Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
Sparc [dwarfdump] Pretty print location expressions and location lists 2017-08-29 21:41:21 +00:00
SystemZ [dwarfdump] Pretty print location expressions and location lists 2017-08-29 21:41:21 +00:00
WebAssembly [WebAssembly] Update debug info test after r312144 2017-08-30 19:54:08 +00:00
X86 Revert "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"" 2017-09-04 15:47:00 +00:00
arm-relocs.test
debuglineinfo-macho.test
debuglineinfo.test
debugmacinfo.test
dwarfdump-64-bit-dwarf.test
dwarfdump-accel.test [DWARF] Generalized verification of .apple_names accelerator table to be applicable to any acceleration table. Added verification for .apple_types, .apple_namespaces and .apple_objc sections. 2017-07-26 00:52:31 +00:00
dwarfdump-debug-frame-simple.test
dwarfdump-decompression-corrupt.test [Object] Verify object sizes before handing out StringRefs pointing out 2017-08-31 12:27:10 +00:00
dwarfdump-decompression-error.test [llvm-dwarfdump] - Print an error message if section decompression failed. 2017-05-05 10:52:39 +00:00
dwarfdump-dump-flags.test
dwarfdump-dump-gdbindex.test [llvm-dwarfdump] - Change format for .gdb_index dump. 2017-04-27 10:00:13 +00:00
dwarfdump-dwp.test
dwarfdump-header.test [DWARFv5] Parse new line-table header format. 2017-05-02 21:40:47 +00:00
dwarfdump-implicit-const.test DebugInfo: support for DW_FORM_implicit_const 2017-01-10 21:18:26 +00:00
dwarfdump-invalid.test
dwarfdump-line-dwo.test
dwarfdump-macho-relocs.test
dwarfdump-macho-universal.test
dwarfdump-objc.test
dwarfdump-pubnames.test
dwarfdump-ranges.test
dwarfdump-str-offsets-dwp.test Adding one test that I forgot to include with the commit for https://reviews.llvm.org/D32779. 2017-06-13 00:42:03 +00:00
dwarfdump-str-offsets-invalid.test [DWARF] Adding support for the DWARF v5 string offsets table (consumer/reader part only). 2017-06-06 01:22:34 +00:00
dwarfdump-str-offsets.test [DWARF] Fixing a bug with processing of DWARF v5 indexed strings in Mach-O objects. 2017-07-13 01:03:28 +00:00
dwarfdump-type-units.test dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents 2016-10-18 21:09:48 +00:00
dwarfdump-zlib.test dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections 2017-06-10 19:32:50 +00:00
dwo.ll Do a better job at emitting prefrabricated skeleton CUs. 2017-07-26 18:48:32 +00:00
invalid-relocations.test [DWARF] - Add testcase for checking message about broken relocations. 2017-07-11 12:29:07 +00:00
llvm-symbolizer-split-dwarf-empty.test [llvm] Get rid of "%T" expansions 2017-08-15 20:29:24 +00:00
llvm-symbolizer-zlib.test
llvm-symbolizer.test Revert changes in r310953 for llvm-symbolizer.test. The change causes a test failure. 2017-08-15 21:02:17 +00:00
macro_link.ll [Debug Info] Added a LIT test that covers the fix committed in rL277290. 2016-08-11 07:22:53 +00:00
member-pointers.o
missing-abstract-variable.o
omit-empty.ll DebugInfo: Consider a CU containing only local imported entities to be 'empty' 2017-07-28 03:06:25 +00:00
pr34186.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
skeletoncu.ll Do a better job at emitting prefrabricated skeleton CUs. 2017-07-26 18:48:32 +00:00
strip-DIGlobalVariable.ll Teach llvm::StripDebugInfo() about global variable !dbg attachments. 2016-10-10 17:53:33 +00:00
strip-loop-metadata.ll Improve DebugInfo/strip-loop-metadata.ll test 2017-03-31 17:51:12 +00:00
typeunit-header.test [DWARF] Fix a parsing issue with type unit headers. 2017-05-09 19:38:38 +00:00
unrolled-loop-remainder.ll [LoopUnroll][DebugInfo] Don't add metadata to unrolled remainder loop 2017-09-04 08:12:16 +00:00