diff options
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDie.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index cec194e8b6b..f278a7a205e 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -119,13 +119,14 @@ static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue, } bool UseLocLists = !U->isDWOUnit(); - StringRef LoclistsSectionData = - UseLocLists ? Obj.getLoclistsSection().Data : U->getLocSectionData(); - - if (!LoclistsSectionData.empty()) { - DataExtractor Data(LoclistsSectionData, Ctx.isLittleEndian(), - Obj.getAddressSize()); - + auto Data = + UseLocLists + ? DWARFDataExtractor(Obj, Obj.getLoclistsSection(), + Ctx.isLittleEndian(), Obj.getAddressSize()) + : DWARFDataExtractor(U->getLocSectionData(), Ctx.isLittleEndian(), + Obj.getAddressSize()); + + if (!Data.getData().empty()) { // Old-style location list were used in DWARF v4 (.debug_loc.dwo section). // Modern locations list (.debug_loclists) are used starting from v5. // Ideally we should take the version from the .debug_loclists section |

