Skip to content

Commit 0e45f34

Browse files
committed
minor nits, made a test single threaded. I think technically speaking it's not legal
1 parent 23590c0 commit 0e45f34

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
775775
using value_type = NameTableEntry;
776776
using difference_type = uint32_t;
777777
using pointer = NameTableEntry *;
778-
using reference = NameTableEntry;
778+
using reference = NameTableEntry; // We return entries by value.
779779

780780
/// Creates an iterator whose initial position is name CurrentName in
781781
/// CurrentIndex.

llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "llvm/Support/raw_ostream.h"
3939
#include <map>
4040
#include <set>
41-
#include <unordered_set>
4241
#include <vector>
4342

4443
using namespace llvm;
@@ -1227,7 +1226,7 @@ void DWARFVerifier::verifyDebugNamesCULists(const DWARFDebugNames &AccelTable) {
12271226
DenseMap<uint64_t, uint64_t> CUMap;
12281227
CUMap.reserve(DCtx.getNumCompileUnits());
12291228

1230-
std::unordered_set<uint64_t> CUOffsets;
1229+
DenseSet<uint64_t> CUOffsets;
12311230
for (const auto &CU : DCtx.compile_units())
12321231
CUOffsets.insert(CU->getOffset());
12331232

@@ -1523,8 +1522,7 @@ static SmallVector<std::string, 3> getNames(const DWARFDie &DIE,
15231522
bool IncludeObjCNames = true,
15241523
bool IncludeLinkageName = true) {
15251524
SmallVector<std::string, 3> Result;
1526-
const char *Str = DIE.getShortName();
1527-
if (Str) {
1525+
if (const char *Str = DIE.getShortName()) {
15281526
StringRef Name(Str);
15291527
Result.emplace_back(Name);
15301528
if (IncludeStrippedTemplateNames) {
@@ -1949,8 +1947,8 @@ static void extractCUsTus(DWARFContext &DCtx) {
19491947
for (const auto &CU : DCtx.compile_units()) {
19501948
if (!(CU->getVersion() >= 5 && CU->getDWOId()))
19511949
continue;
1952-
DWARFUnit *NonSkeletonUnit = CU->getNonSkeletonUnitDIE().getDwarfUnit();
1953-
DWARFContext &NonSkeletonContext = NonSkeletonUnit->getContext();
1950+
DWARFContext &NonSkeletonContext =
1951+
CU->getNonSkeletonUnitDIE().getDwarfUnit()->getContext();
19541952
// Iterates over CUs and TUs.
19551953
for (auto &CUTU : NonSkeletonContext.dwo_units()) {
19561954
CUTU->getUnitDIE();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# This test generates a DW_TAG_structure_type with a linkage name. This linkage
22
# name will not be part of the accelerator table and the verifier should not
33
# complain about this.
4+
# Technically speaking this test is invalid because .debug_names is a DWARF 5 feature.
5+
# In this test the accelerator table is referencing DWARF4.
46
#
57
# DW_TAG_structure_type
68
# DW_AT_name ("C")
@@ -9,7 +11,7 @@
911
# RUN: llvm-mc %s -filetype obj -triple x86_64-unknown-linux-gnu -o %t.o
1012
# RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
1113
# RUN: llvm-dwarfdump -debug-names %t.o | FileCheck %s --check-prefix ACCEL
12-
# RUN: llvm-dwarfdump -verify -debug-names %t.o
14+
# RUN: llvm-dwarfdump -verify --verify-num-threads 1 -debug-names %t.o
1315

1416
# CHECK: DW_AT_name ("Bool")
1517
# CHECK-NEXT: DW_AT_linkage_name ("$SSbD")

0 commit comments

Comments
 (0)