Skip to content

Commit 7c4c72b

Browse files
authored
[DebugInfo][NFC] Sort DWARF op descriptions, fix versions (#102773)
This sorts DWARF op descriptions in `DWARFExpression.cpp` by opcode and version, packing the standardised ops together. A few ops also had the wrong version listed, so this fixes those versions as well. (The version does not appear to actually be used currently.)
1 parent dab7e3c commit 7c4c72b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ static std::vector<Desc> getOpDescriptions() {
5959
Descriptions[DW_OP_shr] = Desc(Op::Dwarf2);
6060
Descriptions[DW_OP_shra] = Desc(Op::Dwarf2);
6161
Descriptions[DW_OP_xor] = Desc(Op::Dwarf2);
62-
Descriptions[DW_OP_skip] = Desc(Op::Dwarf2, Op::SignedSize2);
6362
Descriptions[DW_OP_bra] = Desc(Op::Dwarf2, Op::SignedSize2);
6463
Descriptions[DW_OP_eq] = Desc(Op::Dwarf2);
6564
Descriptions[DW_OP_ge] = Desc(Op::Dwarf2);
6665
Descriptions[DW_OP_gt] = Desc(Op::Dwarf2);
6766
Descriptions[DW_OP_le] = Desc(Op::Dwarf2);
6867
Descriptions[DW_OP_lt] = Desc(Op::Dwarf2);
6968
Descriptions[DW_OP_ne] = Desc(Op::Dwarf2);
69+
Descriptions[DW_OP_skip] = Desc(Op::Dwarf2, Op::SignedSize2);
7070
for (uint16_t LA = DW_OP_lit0; LA <= DW_OP_lit31; ++LA)
7171
Descriptions[LA] = Desc(Op::Dwarf2);
7272
for (uint16_t LA = DW_OP_reg0; LA <= DW_OP_reg31; ++LA)
@@ -88,20 +88,20 @@ static std::vector<Desc> getOpDescriptions() {
8888
Descriptions[DW_OP_call_frame_cfa] = Desc(Op::Dwarf3);
8989
Descriptions[DW_OP_bit_piece] = Desc(Op::Dwarf3, Op::SizeLEB, Op::SizeLEB);
9090
Descriptions[DW_OP_implicit_value] =
91-
Desc(Op::Dwarf3, Op::SizeLEB, Op::SizeBlock);
92-
Descriptions[DW_OP_stack_value] = Desc(Op::Dwarf3);
91+
Desc(Op::Dwarf4, Op::SizeLEB, Op::SizeBlock);
92+
Descriptions[DW_OP_stack_value] = Desc(Op::Dwarf4);
93+
Descriptions[DW_OP_addrx] = Desc(Op::Dwarf5, Op::SizeLEB);
94+
Descriptions[DW_OP_constx] = Desc(Op::Dwarf5, Op::SizeLEB);
95+
Descriptions[DW_OP_entry_value] = Desc(Op::Dwarf5, Op::SizeLEB);
96+
Descriptions[DW_OP_convert] = Desc(Op::Dwarf5, Op::BaseTypeRef);
97+
Descriptions[DW_OP_regval_type] =
98+
Desc(Op::Dwarf5, Op::SizeLEB, Op::BaseTypeRef);
9399
Descriptions[DW_OP_WASM_location] =
94100
Desc(Op::Dwarf4, Op::SizeLEB, Op::WasmLocationArg);
95101
Descriptions[DW_OP_GNU_push_tls_address] = Desc(Op::Dwarf3);
96102
Descriptions[DW_OP_GNU_addr_index] = Desc(Op::Dwarf4, Op::SizeLEB);
97103
Descriptions[DW_OP_GNU_const_index] = Desc(Op::Dwarf4, Op::SizeLEB);
98104
Descriptions[DW_OP_GNU_entry_value] = Desc(Op::Dwarf4, Op::SizeLEB);
99-
Descriptions[DW_OP_addrx] = Desc(Op::Dwarf5, Op::SizeLEB);
100-
Descriptions[DW_OP_constx] = Desc(Op::Dwarf5, Op::SizeLEB);
101-
Descriptions[DW_OP_convert] = Desc(Op::Dwarf5, Op::BaseTypeRef);
102-
Descriptions[DW_OP_entry_value] = Desc(Op::Dwarf5, Op::SizeLEB);
103-
Descriptions[DW_OP_regval_type] =
104-
Desc(Op::Dwarf5, Op::SizeLEB, Op::BaseTypeRef);
105105
// This Description acts as a marker that getSubOpDesc must be called
106106
// to fetch the final Description for the operation. Each such final
107107
// Description must share the same first SizeSubOpLEB operand.

0 commit comments

Comments
 (0)