DebugInfo: Deduplicate addresses in debug_addr
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Oct 2019 02:48:42 +0000 (19:48 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 27 Jan 2021 22:00:43 +0000 (14:00 -0800)
commit7e6c87ee045497ee0b6b7e55e54921b274e8a9f2
tree4ac6c9f8c2fa34f6836c4be089bab958e5184c09
parenta7246ba02a8923f316419a62d836dbe1c0b437bd
DebugInfo: Deduplicate addresses in debug_addr

Experimental, using non-existent DWARF support to use an expr for the
location involving an addr_index (to compute address + offset so
addresses can be reused in more places).

The global variable debug info had to be deferred until the end of the
module (so bss variables would all be emitted first - so their labels
would have the relevant section). Non-bss variables seemed to not have
their label assigned to a section even at the end of the module, so I
didn't know what to do there.

Also, the hashing code is broken - doesn't know how to hash these
expressions (& isn't hashing anything inside subprograms, which seems
problematic), so for test purposes this change just skips the hash
computation. (GCC's actually overly sensitive in its hash function, it
seems - I'm forgetting the specific case right now - anyway, we might
want to just use the frontend-known file hash and give up on optimistic
.dwo/.dwp reuse)
llvm/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
llvm/test/DebugInfo/X86/ranges_always.ll