DebugInfo: Reduce long-distance dependence on what will/won't emit a debug_addr section
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 17 May 2020 19:17:31 +0000 (12:17 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 17 May 2020 19:45:56 +0000 (12:45 -0700)
commita055e3856f813f73d82e992cfe78dcdb918a39c5
treea7b2034dacc0c8c0ea32985ebb9bfa8718348e30
parent39beeeff205caf75ee56ff8967e2b12e7b3fb644
DebugInfo: Reduce long-distance dependence on what will/won't emit a debug_addr section

This is a no-op/NFC at the moment & generally makes the code /somewhat/
cleaner/less reliant on assumptions about what will produce a debug_addr
section.

It's still a bit "spooky action at a distance" - the add ranges code
pre-emptively inserts addresses into the address pool it knows will
eventually be used by the range emission code (or low/high pc).

The 'ideal' would be either to actually compute the addresses needed for
range (& loc) emission earlier - which would mean decanonicalizing the
range/loc representation earlier to account for whether it was going to
use addrx encodings or not (which would be unfortunate, but could be
refactored to be relatively unobtrusive).

Alternatively, emitting the range/loc sections earlier would cause them
to request the needed addresses sooner - but then you endup having to
split finalizeModuleInfo because some things need to be handled there
before the ranges/locs are emitted, I think...
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp