Skip to content

Commit 853179f

Browse files
committed
[NFC] Use the DWARFExpression::Stack typedef
This commit updates the places where we were passing around the dwarf expression stack to use the typedef value instead of redeclaring the underlying vector type. It looked like a nice cleanup to use the typedef instead.
1 parent c6969e5 commit 853179f

File tree

8 files changed

+22
-21
lines changed

8 files changed

+22
-21
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "DWARFUnit.h"
1010

1111
#include "lldb/Core/Module.h"
12+
#include "lldb/Expression/DWARFExpression.h"
1213
#include "lldb/Symbol/ObjectFile.h"
1314
#include "lldb/Utility/LLDBAssert.h"
1415
#include "lldb/Utility/StreamString.h"
@@ -738,7 +739,7 @@ bool DWARFUnit::ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
738739
lldb::offset_t &offset,
739740
RegisterContext *reg_ctx,
740741
lldb::RegisterKind reg_kind,
741-
std::vector<Value> &stack) const {
742+
DWARFExpression::Stack &stack) const {
742743
return GetSymbolFileDWARF().ParseVendorDWARFOpcode(op, opcodes, offset,
743744
reg_ctx, reg_kind, stack);
744745
}

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ class DWARFUnit : public DWARFExpression::Delegate, public UserID {
164164
const lldb::offset_t data_offset,
165165
const uint8_t op) const override;
166166

167-
virtual bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
168-
lldb::offset_t &offset,
169-
RegisterContext *reg_ctx,
170-
lldb::RegisterKind reg_kind,
171-
std::vector<Value> &stack) const override;
167+
virtual bool
168+
ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
169+
lldb::offset_t &offset, RegisterContext *reg_ctx,
170+
lldb::RegisterKind reg_kind,
171+
DWARFExpression::Stack &stack) const override;
172172

173173
bool ParseDWARFLocationList(const DataExtractor &data,
174174
DWARFExpressionList &loc_list) const;

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "lldb/Core/UniqueCStringMap.h"
2424
#include "lldb/Core/dwarf.h"
25+
#include "lldb/Expression/DWARFExpression.h"
2526
#include "lldb/Expression/DWARFExpressionList.h"
2627
#include "lldb/Symbol/DebugMacros.h"
2728
#include "lldb/Symbol/SymbolContext.h"
@@ -334,7 +335,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
334335
lldb::offset_t &offset,
335336
RegisterContext *reg_ctx,
336337
lldb::RegisterKind reg_kind,
337-
std::vector<Value> &stack) const {
338+
DWARFExpression::Stack &stack) const {
338339
return false;
339340
}
340341

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ uint64_t SymbolFileDWARFDwo::GetDebugInfoSize(bool load_all_debug_info) {
9999
bool SymbolFileDWARFDwo::ParseVendorDWARFOpcode(
100100
uint8_t op, const DataExtractor &opcodes, lldb::offset_t &offset,
101101
RegisterContext *reg_ctx, lldb::RegisterKind reg_kind,
102-
std::vector<Value> &stack) const {
102+
DWARFExpression::Stack &stack) const {
103103
return GetBaseSymbolFile().ParseVendorDWARFOpcode(op, opcodes, offset,
104104
reg_ctx, reg_kind, stack);
105105
}

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
5454
bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
5555
lldb::offset_t &offset, RegisterContext *reg_ctx,
5656
lldb::RegisterKind reg_kind,
57-
std::vector<Value> &stack) const override;
57+
DWARFExpression::Stack &stack) const override;
5858

5959
void FindGlobalVariables(ConstString name,
6060
const CompilerDeclContext &parent_decl_ctx,

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@ SymbolFileWasm::GetVendorDWARFOpcodeSize(const DataExtractor &data,
4646
return offset - data_offset;
4747
}
4848

49-
bool SymbolFileWasm::ParseVendorDWARFOpcode(uint8_t op,
50-
const DataExtractor &opcodes,
51-
lldb::offset_t &offset,
52-
RegisterContext *reg_ctx,
53-
lldb::RegisterKind reg_kind,
54-
std::vector<Value> &stack) const {
49+
bool SymbolFileWasm::ParseVendorDWARFOpcode(
50+
uint8_t op, const DataExtractor &opcodes, lldb::offset_t &offset,
51+
RegisterContext *reg_ctx, lldb::RegisterKind reg_kind,
52+
DWARFExpression::Stack &stack) const {
5553
if (op != llvm::dwarf::DW_OP_WASM_location)
5654
return false;
5755

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileWasm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEWASM_H
1111

1212
#include "SymbolFileDWARF.h"
13+
#include "lldb/Expression/DWARFExpression.h"
1314

1415
namespace lldb_private::plugin {
1516
namespace dwarf {
@@ -26,7 +27,7 @@ class SymbolFileWasm : public SymbolFileDWARF {
2627
bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
2728
lldb::offset_t &offset, RegisterContext *reg_ctx,
2829
lldb::RegisterKind reg_kind,
29-
std::vector<Value> &stack) const override;
30+
DWARFExpression::Stack &stack) const override;
3031
};
3132
} // namespace dwarf
3233
} // namespace lldb_private::plugin

lldb/unittests/Expression/DWARFExpressionTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,12 @@ class CustomSymbolFileDWARF : public SymbolFileDWARF {
743743
return offset - data_offset;
744744
}
745745

746-
virtual bool ParseVendorDWARFOpcode(
747-
uint8_t op, const lldb_private::DataExtractor &opcodes,
748-
lldb::offset_t &offset,
746+
virtual bool
747+
ParseVendorDWARFOpcode(uint8_t op, const lldb_private::DataExtractor &opcodes,
748+
lldb::offset_t &offset,
749749

750-
RegisterContext *reg_ctx, lldb::RegisterKind reg_kind,
751-
std::vector<lldb_private::Value> &stack) const override {
750+
RegisterContext *reg_ctx, lldb::RegisterKind reg_kind,
751+
DWARFExpression::Stack &stack) const override {
752752
if (op != DW_OP_WASM_location) {
753753
return false;
754754
}

0 commit comments

Comments
 (0)