Skip to content

Commit c46be28

Browse files
committed
Change wording for Scope comment
1 parent 0795d56 commit c46be28

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

llvm/test/TableGen/FixedLenDecoderEmitter/additional-encoding.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ class I<dag out_ops, dag in_ops> : Instruction {
3232

3333
// CHECK: /* 0 */ OPC_ExtractField, 12, 4, // Field = Inst{15-12}
3434
// CHECK-NEXT: /* 3 */ OPC_FilterValueOrSkip, 0, 15, 0, // if Field != 0x0 skip to 22
35-
// CHECK-NEXT: /* 7 */ OPC_Scope, 8, 0, // skip to 18
35+
// CHECK-NEXT: /* 7 */ OPC_Scope, 8, 0, // end scope at 18
3636
// CHECK-NEXT: /* 10 */ OPC_CheckField, 6, 6, 0, // if Inst{11-6} != 0x0
3737
// CHECK-NEXT: /* 14 */ OPC_Decode, {{[0-9]+}}, 2, 0, // Opcode: {{.*}}:NOP, DecodeIdx: 0
3838
// CHECK-NEXT: /* 18 */ OPC_TryDecode, {{[0-9]+}}, 2, 1, // Opcode: SHIFT0, DecodeIdx: 1
3939
// CHECK-NEXT: /* 22 */ OPC_FilterValueOrSkip, 1, 15, 0, // if Field != 0x1 skip to 41
40-
// CHECK-NEXT: /* 26 */ OPC_Scope, 8, 0, // skip to 37
40+
// CHECK-NEXT: /* 26 */ OPC_Scope, 8, 0, // end scope at 37
4141
// CHECK-NEXT: /* 29 */ OPC_CheckField, 6, 6, 0, // if Inst{11-6} != 0x0
4242
// CHECK-NEXT: /* 33 */ OPC_Decode, {{[0-9]+}}, 2, 0, // Opcode: {{.*}}:NOP, DecodeIdx: 0
4343
// CHECK-NEXT: /* 37 */ OPC_TryDecode, {{[0-9]+}}, 2, 1, // Opcode: SHIFT1, DecodeIdx: 1
4444
// CHECK-NEXT: /* 41 */ OPC_FilterValueOrSkip, 2, 15, 0, // if Field != 0x2 skip to 60
45-
// CHECK-NEXT: /* 45 */ OPC_Scope, 8, 0, // skip to 56
45+
// CHECK-NEXT: /* 45 */ OPC_Scope, 8, 0, // end scope at 56
4646
// CHECK-NEXT: /* 48 */ OPC_CheckField, 6, 6, 0, // if Inst{11-6} != 0x0
4747
// CHECK-NEXT: /* 52 */ OPC_Decode, {{[0-9]+}}, 2, 0, // Opcode: {{.*}}:NOP, DecodeIdx: 0
4848
// CHECK-NEXT: /* 56 */ OPC_TryDecode, {{[0-9]+}}, 2, 1, // Opcode: SHIFT2, DecodeIdx: 1
4949
// CHECK-NEXT: /* 60 */ OPC_FilterValue, 3, // if Field != 0x3
50-
// CHECK-NEXT: /* 62 */ OPC_Scope, 8, 0, // skip to 73
50+
// CHECK-NEXT: /* 62 */ OPC_Scope, 8, 0, // end scope at 73
5151
// CHECK-NEXT: /* 65 */ OPC_CheckField, 6, 6, 0, // if Inst{11-6} != 0x0
5252
// CHECK-NEXT: /* 69 */ OPC_Decode, {{[0-9]+}}, 2, 0, // Opcode: {{.*}}:NOP, DecodeIdx: 0
5353
// CHECK-NEXT: /* 73 */ OPC_TryDecode, {{[0-9]+}}, 2, 1, // Opcode: SHIFT3, DecodeIdx: 1

llvm/test/TableGen/FixedLenDecoderEmitter/var-len-conflict-1.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class I : Instruction {
1818
// 00000001 ________ I16_1
1919
// 00000010 ________ I16_2
2020

21-
// CHECK: /* 0 */ OPC_Scope, 17, 0, // skip to 20
21+
// CHECK: /* 0 */ OPC_Scope, 17, 0, // end scope at 20
2222
// CHECK-NEXT: /* 3 */ OPC_ExtractField, 0, 1, // Field = Inst{0}
2323
// CHECK-NEXT: /* 6 */ OPC_FilterValueOrSkip, 0, 4, 0, // if Field != 0x0 skip to 14
2424
// CHECK-NEXT: /* 10 */ OPC_Decode, {{[0-9]+}}, 2, 0, // Opcode: I8_0, DecodeIdx: 0

llvm/test/TableGen/trydecode-emission.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def InstB : TestInstruction {
3535
}
3636

3737
// CHECK: /* 0 */ OPC_CheckField, 4, 4, 0, // if Inst{7-4} != 0x0
38-
// CHECK-NEXT: /* 4 */ OPC_Scope, 8, 0, // skip to 15
38+
// CHECK-NEXT: /* 4 */ OPC_Scope, 8, 0, // end scope at 15
3939
// CHECK-NEXT: /* 7 */ OPC_CheckField, 2, 2, 0, // if Inst{3-2} != 0x0
4040
// CHECK-NEXT: /* 11 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0, // Opcode: InstB, DecodeIdx: 0
4141
// CHECK-NEXT: /* 15 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1
@@ -48,7 +48,7 @@ def InstB : TestInstruction {
4848
// CHECK-NEXT: return NumToSkip;
4949

5050
// CHECK-LARGE: /* 0 */ OPC_CheckField, 4, 4, 0, // if Inst{7-4} != 0x0
51-
// CHECK-LARGE-NEXT: /* 4 */ OPC_Scope, 8, 0, 0, // skip to 16
51+
// CHECK-LARGE-NEXT: /* 4 */ OPC_Scope, 8, 0, 0, // end scope at 16
5252
// CHECK-LARGE-NEXT: /* 8 */ OPC_CheckField, 2, 2, 0, // if Inst{3-2} != 0x0
5353
// CHECK-LARGE-NEXT: /* 12 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0, // Opcode: InstB, DecodeIdx: 0
5454
// CHECK-LARGE-NEXT: /* 16 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1

llvm/test/TableGen/trydecode-emission2.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def InstB : TestInstruction {
3333

3434
// CHECK: /* 0 */ OPC_CheckField, 2, 1, 0,
3535
// CHECK-NEXT: /* 4 */ OPC_CheckField, 5, 3, 0,
36-
// CHECK-NEXT: /* 8 */ OPC_Scope, 8, 0, // skip to 19
36+
// CHECK-NEXT: /* 8 */ OPC_Scope, 8, 0, // end scope at 19
3737
// CHECK-NEXT: /* 11 */ OPC_CheckField, 0, 2, 3,
3838
// CHECK-NEXT: /* 15 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
3939
// CHECK-NEXT: /* 19 */ OPC_CheckField, 3, 2, 0,
@@ -44,7 +44,7 @@ def InstB : TestInstruction {
4444

4545
// CHECK-LARGE: /* 0 */ OPC_CheckField, 2, 1, 0,
4646
// CHECK-LARGE-NEXT: /* 4 */ OPC_CheckField, 5, 3, 0,
47-
// CHECK-LARGE-NEXT: /* 8 */ OPC_Scope, 8, 0, 0, // skip to 20
47+
// CHECK-LARGE-NEXT: /* 8 */ OPC_Scope, 8, 0, 0, // end scope at 20
4848
// CHECK-LARGE-NEXT: /* 12 */ OPC_CheckField, 0, 2, 3,
4949
// CHECK-LARGE-NEXT: /* 16 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
5050
// CHECK-LARGE-NEXT: /* 20 */ OPC_CheckField, 3, 2, 0,

llvm/test/TableGen/trydecode-emission3.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def InstB : TestInstruction {
3636
}
3737

3838
// CHECK: /* 0 */ OPC_CheckField, 4, 4, 0,
39-
// CHECK-NEXT: /* 4 */ OPC_Scope, 8, 0, // skip to 15
39+
// CHECK-NEXT: /* 4 */ OPC_Scope, 8, 0, // end scope at 15
4040
// CHECK-NEXT: /* 7 */ OPC_CheckField, 2, 2, 0,
4141
// CHECK-NEXT: /* 11 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
4242
// CHECK-NEXT: /* 15 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1
@@ -45,7 +45,7 @@ def InstB : TestInstruction {
4545
// CHECK: if (!Check(S, DecodeInstBOp(MI, tmp, Address, Decoder))) { DecodeComplete = false; return MCDisassembler::Fail; }
4646

4747
// CHECK-LARGE: /* 0 */ OPC_CheckField, 4, 4, 0,
48-
// CHECK-LARGE-NEXT: /* 4 */ OPC_Scope, 8, 0, 0, // skip to 16
48+
// CHECK-LARGE-NEXT: /* 4 */ OPC_Scope, 8, 0, 0, // end scope at 16
4949
// CHECK-LARGE-NEXT: /* 8 */ OPC_CheckField, 2, 2, 0,
5050
// CHECK-LARGE-NEXT: /* 12 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
5151
// CHECK-LARGE-NEXT: /* 16 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1

llvm/test/TableGen/trydecode-emission4.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def InstB : TestInstruction {
3434
}
3535

3636
// CHECK: /* 0 */ OPC_CheckField, 250, 3, 4, 0,
37-
// CHECK-NEXT: /* 5 */ OPC_Scope, 9, 0, // skip to 17
37+
// CHECK-NEXT: /* 5 */ OPC_Scope, 9, 0, // end scope at 17
3838
// CHECK-NEXT: /* 8 */ OPC_CheckField, 248, 3, 2, 0,
3939
// CHECK-NEXT: /* 13 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
4040
// CHECK-NEXT: /* 17 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1
@@ -44,7 +44,7 @@ def InstB : TestInstruction {
4444

4545

4646
// CHECK-LARGE: /* 0 */ OPC_CheckField, 250, 3, 4, 0,
47-
// CHECK-LARGE-NEXT: /* 5 */ OPC_Scope, 9, 0, 0, // skip to 18
47+
// CHECK-LARGE-NEXT: /* 5 */ OPC_Scope, 9, 0, 0, // end scope at 18
4848
// CHECK-LARGE-NEXT: /* 9 */ OPC_CheckField, 248, 3, 2, 0,
4949
// CHECK-LARGE-NEXT: /* 14 */ OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0,
5050
// CHECK-LARGE-NEXT: /* 18 */ OPC_Decode, {{[0-9]+}}, {{[0-9]+}}, 1, // Opcode: InstA, DecodeIdx: 1

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ unsigned DecoderEmitter::emitTable(formatted_raw_ostream &OS,
807807
};
808808

809809
auto EmitNumToSkipComment = [&](uint32_t NumToSkip) {
810-
uint32_t Index = ((I - Table.begin()) + NumToSkip);
810+
uint32_t Index = (I - Table.begin()) + NumToSkip;
811811
OS << "skip to " << Index;
812812
};
813813

@@ -848,7 +848,8 @@ unsigned DecoderEmitter::emitTable(formatted_raw_ostream &OS,
848848
case OPC_Scope: {
849849
uint32_t NumToSkip = EmitNumToSkip(I, OS);
850850
StartComment();
851-
EmitNumToSkipComment(NumToSkip);
851+
uint32_t Index = (I - Table.begin()) + NumToSkip;
852+
OS << "end scope at " << Index;
852853
break;
853854
}
854855
case OPC_ExtractField: {

0 commit comments

Comments
 (0)