[NFC][DWARFLinker] Refactor address emitting code.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 20 Jan 2023 15:48:13 +0000 (16:48 +0100)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 20 Jan 2023 16:44:07 +0000 (17:44 +0100)
commitfa2a03dc7acd0ba551a3328a2d9d5d313e9043d1
tree8b5478bf68b3cd828d3e496c6c66fe6dd09758c8
parent7c59deaa1150a1bccf8090ba798ba93fdfe335e0
[NFC][DWARFLinker] Refactor address emitting code.

As a preparation for implementing DWARFv5 address ranges generation,
this patch refactors existing address ranges generation code:
Split emitUnitRangesEntries into two functions emitDwarfDebugArangesTable
and emitDwarfDebugRangesTableFragment. Use AddressRanges to prepare linked
address ranges. Refactor Unit.getLowPc(), to use std::nullopt as undefined value.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D141943
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
llvm/include/llvm/DWARFLinker/DWARFStreamer.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/lib/DWARFLinker/DWARFLinkerCompileUnit.cpp
llvm/lib/DWARFLinker/DWARFStreamer.cpp