@@ -306,8 +306,7 @@ class FilterChooser;
306
306
// / version and return the Opcode since the two have the same Asm format string.
307
307
class Filter {
308
308
protected:
309
- const FilterChooser
310
- *Owner; // points to the FilterChooser who owns this filter
309
+ const FilterChooser &Owner; // FilterChooser who owns this filter
311
310
unsigned StartBit; // the starting bit position
312
311
unsigned NumBits; // number of bits to filter
313
312
bool Mixed; // a mixed region contains both set and unset bits
@@ -329,7 +328,8 @@ class Filter {
329
328
330
329
public:
331
330
Filter (Filter &&f);
332
- Filter (FilterChooser &owner, unsigned startBit, unsigned numBits, bool mixed);
331
+ Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
332
+ bool mixed);
333
333
334
334
~Filter () = default ;
335
335
@@ -589,22 +589,22 @@ Filter::Filter(Filter &&f)
589
589
FilterChooserMap(std::move(f.FilterChooserMap)),
590
590
NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
591
591
592
- Filter::Filter (FilterChooser &owner, unsigned startBit, unsigned numBits,
592
+ Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
593
593
bool mixed)
594
- : Owner(& owner), StartBit(startBit), NumBits(numBits), Mixed(mixed) {
595
- assert (StartBit + NumBits - 1 < Owner-> BitWidth );
594
+ : Owner(owner), StartBit(startBit), NumBits(numBits), Mixed(mixed) {
595
+ assert (StartBit + NumBits - 1 < Owner. BitWidth );
596
596
597
597
NumFiltered = 0 ;
598
598
LastOpcFiltered = {0 , 0 };
599
599
600
- for (const auto &OpcPair : Owner-> Opcodes ) {
600
+ for (const auto &OpcPair : Owner. Opcodes ) {
601
601
insn_t Insn;
602
602
603
603
// Populates the insn given the uid.
604
- Owner-> insnWithID (Insn, OpcPair.EncodingID );
604
+ Owner. insnWithID (Insn, OpcPair.EncodingID );
605
605
606
606
// Scans the segment for possibly well-specified encoding bits.
607
- auto [Ok, Field] = Owner-> fieldFromInsn (Insn, StartBit, NumBits);
607
+ auto [Ok, Field] = Owner. fieldFromInsn (Insn, StartBit, NumBits);
608
608
609
609
if (Ok) {
610
610
// The encoding bits are well-known. Lets add the uid of the
@@ -631,7 +631,7 @@ Filter::Filter(FilterChooser &owner, unsigned startBit, unsigned numBits,
631
631
// match the remaining undecoded encoding bits against the singleton.
632
632
void Filter::recurse () {
633
633
// Starts by inheriting our parent filter chooser's filter bit values.
634
- std::vector<bit_value_t > BitValueArray (Owner-> FilterBitValues );
634
+ std::vector<bit_value_t > BitValueArray (Owner. FilterBitValues );
635
635
636
636
if (!VariableInstructions.empty ()) {
637
637
// Conservatively marks each segment position as BIT_UNSET.
@@ -642,9 +642,9 @@ void Filter::recurse() {
642
642
// group of instructions whose segment values are variable.
643
643
FilterChooserMap.try_emplace (
644
644
NO_FIXED_SEGMENTS_SENTINEL,
645
- std::make_unique<FilterChooser>(Owner-> AllInstructions ,
646
- VariableInstructions, Owner-> Operands ,
647
- BitValueArray, * Owner));
645
+ std::make_unique<FilterChooser>(Owner. AllInstructions ,
646
+ VariableInstructions, Owner. Operands ,
647
+ BitValueArray, Owner));
648
648
}
649
649
650
650
// No need to recurse for a singleton filtered instruction.
@@ -667,10 +667,10 @@ void Filter::recurse() {
667
667
668
668
// Delegates to an inferior filter chooser for further processing on this
669
669
// category of instructions.
670
- FilterChooserMap.try_emplace (Inst. first ,
671
- std::make_unique<FilterChooser>(
672
- Owner-> AllInstructions , Inst.second ,
673
- Owner-> Operands , BitValueArray, * Owner));
670
+ FilterChooserMap.try_emplace (
671
+ Inst. first ,
672
+ std::make_unique<FilterChooser>(Owner. AllInstructions , Inst.second ,
673
+ Owner. Operands , BitValueArray, Owner));
674
674
}
675
675
}
676
676
0 commit comments