[llvm] c957927 - Use new DWARFDataExtractor::getInitialLength in DWARFUnit
Pavel Labath via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 04:12:21 PST 2020
Author: Pavel Labath
Date: 2020-03-04T13:01:35+01:00
New Revision: c9579271b349a76f756dc2e3a178e8028396dd8f
URL: https://github.com/llvm/llvm-project/commit/c9579271b349a76f756dc2e3a178e8028396dd8f
DIFF: https://github.com/llvm/llvm-project/commit/c9579271b349a76f756dc2e3a178e8028396dd8f.diff
LOG: Use new DWARFDataExtractor::getInitialLength in DWARFUnit
Added:
Modified:
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index f3fd48c6ba75..9e71ef5f43f5 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -262,12 +262,8 @@ bool DWARFUnitHeader::extract(DWARFContext &Context,
IndexEntry = Entry;
if (!IndexEntry && Index)
IndexEntry = Index->getFromOffset(*offset_ptr);
- Length = debug_info.getRelocatedValue(4, offset_ptr, nullptr, &Err);
- FormParams.Format = DWARF32;
- if (Length == dwarf::DW_LENGTH_DWARF64) {
- Length = debug_info.getU64(offset_ptr, &Err);
- FormParams.Format = DWARF64;
- }
+ std::tie(Length, FormParams.Format) =
+ debug_info.getInitialLength(offset_ptr, &Err);
FormParams.Version = debug_info.getU16(offset_ptr, &Err);
if (FormParams.Version >= 5) {
UnitType = debug_info.getU8(offset_ptr, &Err);
More information about the llvm-commits
mailing list