Skip to content

Commit 3d5ec57

Browse files
committed
annotation and format
1 parent 3ce4c34 commit 3d5ec57

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ class DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1>
143143
decltype(make_filter_range(std::declval<iterator_range>(), isCompileUnit));
144144

145145
LLVM_ABI DWARFUnit *getUnitForOffset(uint64_t Offset) const;
146+
/// Returns the Unit from the .debug_info or .debug_types section by the index
147+
/// entry.
146148
LLVM_ABI DWARFUnit *
147149
getUnitForIndexEntry(const DWARFUnitIndex::Entry &E, DWARFSectionKind Sec,
148150
const DWARFSection *Section = nullptr);

llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,10 +1345,10 @@ DWARFTypeUnit *DWARFContext::getTypeUnitForHash(uint64_t Hash, bool IsDWO) {
13451345
DWARFUnitVector &DWOUnits = State->getDWOUnits();
13461346
if (const auto &TUI = getTUIndex()) {
13471347
if (const auto *R = TUI.getFromHash(Hash)) {
1348-
if (TUI.getVersion() >= 5)
1348+
if (TUI.getVersion() >= 5) {
13491349
return dyn_cast_or_null<DWARFTypeUnit>(
13501350
DWOUnits.getUnitForIndexEntry(*R, DW_SECT_INFO));
1351-
else {
1351+
} else {
13521352
DWARFUnit *TypesUnit = nullptr;
13531353
getDWARFObj().forEachTypesDWOSections([&](const DWARFSection &S) {
13541354
if (!TypesUnit)

llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## This test uses TU index for type parsing in dwp and makes sure the DWARF4 type is
2+
## successfully retrieved.
3+
14
# RUN: llvm-mc %s --split-dwarf-file=test.dwo -filetype obj -triple x86_64 -o test.o
25
# RUN: llvm-dwp -e test.o -o test.dwp
36
# RUN: llvm-dwarfdump test.dwp | FileCheck %s

0 commit comments

Comments
 (0)