Skip to content

Commit 74799be

Browse files
committed
[lldb] Eliminate namespace lldb_private::dwarf (NFC)
Eliminate the `lldb_private::dwarf` namespace, in favor of using `llvm::dwarf` directly. The latter is shorter, and this avoids ambiguity in the ABI plugins that define a `dwarf` namespace inside an anonymous namespace.
1 parent 2a78c6d commit 74799be

29 files changed

+42
-48
lines changed

lldb/include/lldb/Core/dwarf.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
// Get the DWARF constant definitions from llvm
1515
#include "llvm/BinaryFormat/Dwarf.h"
1616

17-
namespace lldb_private {
18-
namespace dwarf {
19-
using namespace llvm::dwarf;
20-
}
21-
}
22-
2317
typedef llvm::dwarf::Attribute dw_attr_t;
2418
typedef llvm::dwarf::Form dw_form_t;
2519
typedef llvm::dwarf::Tag dw_tag_t;

lldb/source/Expression/DWARFExpression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
using namespace lldb;
4343
using namespace lldb_private;
44-
using namespace lldb_private::dwarf;
4544
using namespace lldb_private::plugin::dwarf;
45+
using namespace llvm::dwarf;
4646

4747
// DWARFExpression constructor
4848
DWARFExpression::DWARFExpression() : m_data() {}

lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static DWARFExpression CreateDWARFExpression(ModuleSP module_sp,
848848
uint32_t byte_size = architecture.GetDataByteSize();
849849

850850
StreamBuffer<32> stream(Stream::eBinary, address_size, byte_order);
851-
stream.PutHex8(lldb_private::dwarf::DW_OP_addr);
851+
stream.PutHex8(llvm::dwarf::DW_OP_addr);
852852
stream.PutMaxHex64(symbol.GetFileAddress(), address_size, byte_order);
853853

854854
DataBufferSP buffer =

lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#include "lldb/Symbol/Function.h"
1616
#include "llvm/Support/DJB.h"
1717

18-
using namespace lldb_private;
1918
using namespace lldb;
20-
using namespace lldb_private::dwarf;
19+
using namespace lldb_private;
2120
using namespace lldb_private::plugin::dwarf;
21+
using namespace llvm::dwarf;
2222

2323
std::unique_ptr<AppleDWARFIndex> AppleDWARFIndex::Create(
2424
Module &module, DWARFDataExtractor apple_names,
@@ -80,7 +80,7 @@ static bool
8080
EntryHasMatchingQualhash(const llvm::AppleAcceleratorTable::Entry &entry,
8181
uint32_t expected_hash) {
8282
std::optional<llvm::DWARFFormValue> form_value =
83-
entry.lookup(dwarf::DW_ATOM_qual_name_hash);
83+
entry.lookup(llvm::dwarf::DW_ATOM_qual_name_hash);
8484
if (!form_value)
8585
return false;
8686
std::optional<uint64_t> hash = form_value->getAsUnsignedConstant();
@@ -93,7 +93,7 @@ EntryHasMatchingQualhash(const llvm::AppleAcceleratorTable::Entry &entry,
9393
static bool EntryHasMatchingTag(const llvm::AppleAcceleratorTable::Entry &entry,
9494
dw_tag_t expected_tag) {
9595
std::optional<llvm::DWARFFormValue> form_value =
96-
entry.lookup(dwarf::DW_ATOM_die_tag);
96+
entry.lookup(llvm::dwarf::DW_ATOM_die_tag);
9797
if (!form_value)
9898
return false;
9999
std::optional<uint64_t> maybe_tag = form_value->getAsUnsignedConstant();
@@ -109,7 +109,7 @@ static bool EntryHasMatchingTag(const llvm::AppleAcceleratorTable::Entry &entry,
109109
static bool
110110
HasImplementationFlag(const llvm::AppleAcceleratorTable::Entry &entry) {
111111
std::optional<llvm::DWARFFormValue> form_value =
112-
entry.lookup(dwarf::DW_ATOM_type_flags);
112+
entry.lookup(llvm::dwarf::DW_ATOM_type_flags);
113113
if (!form_value)
114114
return false;
115115
std::optional<uint64_t> Flags = form_value->getAsUnsignedConstant();

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
using namespace lldb;
2020
using namespace lldb_private;
21-
using namespace lldb_private::dwarf;
2221
using namespace lldb_private::plugin::dwarf;
22+
using namespace llvm::dwarf;
2323

2424
std::optional<SymbolFile::ArrayInfo>
2525
DWARFASTParser::ParseChildArrayInfo(const DWARFDIE &parent_die,

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565

6666
using namespace lldb;
6767
using namespace lldb_private;
68-
using namespace lldb_private::dwarf;
6968
using namespace lldb_private::plugin::dwarf;
69+
using namespace llvm::dwarf;
7070

7171
DWARFASTParserClang::DWARFASTParserClang(TypeSystemClang &ast)
7272
: DWARFASTParser(Kind::DWARFASTParserClang), m_ast(ast),

lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "DWARFUnit.h"
1111
#include "DWARFDebugInfo.h"
1212

13-
using namespace lldb_private::dwarf;
13+
using namespace llvm::dwarf;
1414
using namespace lldb_private::plugin::dwarf;
1515

1616
DWARFAttributes::DWARFAttributes() : m_infos() {}

lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include "llvm/Support/raw_ostream.h"
2424

2525
using namespace lldb_private;
26-
using namespace lldb_private::dwarf;
2726
using namespace lldb_private::plugin::dwarf;
27+
using namespace llvm::dwarf;
2828

2929
namespace {
3030

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void DWARFDebugInfo::ParseUnitsFor(DIERef::Section section) {
106106
// table lookups can cause the DWO files to be accessed before the skeleton
107107
// compile unit is parsed, so we keep a map to allow us to match up the DWO
108108
// file to the back to the skeleton compile units.
109-
if (unit_sp->GetUnitType() == lldb_private::dwarf::DW_UT_skeleton) {
109+
if (unit_sp->GetUnitType() == llvm::dwarf::DW_UT_skeleton) {
110110
if (std::optional<uint64_t> unit_dwo_id = unit_sp->GetHeaderDWOId())
111111
m_dwarf5_dwo_id_to_skeleton_unit[*unit_dwo_id] = unit_sp.get();
112112
}

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#include "SymbolFileDWARFDwo.h"
3535

3636
using namespace lldb_private;
37-
using namespace lldb_private::dwarf;
3837
using namespace lldb_private::plugin::dwarf;
38+
using namespace llvm::dwarf;
3939
extern int g_verbose;
4040

4141
// Extract a debug info entry for a given DWARFUnit from the data

0 commit comments

Comments
 (0)