Skip to content

Commit 3acb679

Browse files
committed
[TableGen] Remove redundant variable (NFC)
1 parent 351d398 commit 3acb679

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@ class Filter {
398398
// Number of instructions which fall under FilteredInstructions category.
399399
unsigned NumFiltered;
400400

401-
// Keeps track of the last opcode in the filtered bucket.
402-
EncodingIDAndOpcode LastOpcFiltered;
403-
404401
public:
405402
Filter(Filter &&f);
406403
Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits);
@@ -411,7 +408,7 @@ class Filter {
411408

412409
EncodingIDAndOpcode getSingletonOpc() const {
413410
assert(NumFiltered == 1);
414-
return LastOpcFiltered;
411+
return FilteredInstructions.begin()->second.front();
415412
}
416413

417414
// Return the filter chooser for the group of instructions without constant
@@ -650,14 +647,13 @@ Filter::Filter(Filter &&f)
650647
FilteredInstructions(std::move(f.FilteredInstructions)),
651648
VariableInstructions(std::move(f.VariableInstructions)),
652649
FilterChooserMap(std::move(f.FilterChooserMap)),
653-
NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
650+
NumFiltered(f.NumFiltered) {}
654651

655652
Filter::Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits)
656653
: Owner(owner), StartBit(startBit), NumBits(numBits) {
657654
assert(StartBit + NumBits - 1 < Owner.BitWidth);
658655

659656
NumFiltered = 0;
660-
LastOpcFiltered = {0, 0};
661657

662658
for (const auto &OpcPair : Owner.Opcodes) {
663659
// Populates the insn given the uid.
@@ -669,8 +665,7 @@ Filter::Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits)
669665
if (Ok) {
670666
// The encoding bits are well-known. Lets add the uid of the
671667
// instruction into the bucket keyed off the constant field value.
672-
LastOpcFiltered = OpcPair;
673-
FilteredInstructions[Field].push_back(LastOpcFiltered);
668+
FilteredInstructions[Field].push_back(OpcPair);
674669
++NumFiltered;
675670
} else {
676671
// Some of the encoding bit(s) are unspecified. This contributes to

0 commit comments

Comments
 (0)