@@ -1553,18 +1553,17 @@ void FilterChooser::reportRegion(bitAttr_t RA, unsigned StartBit,
1553
1553
bool FilterChooser::filterProcessor (bool AllowMixed, bool Greedy) {
1554
1554
Filters.clear ();
1555
1555
BestIndex = -1 ;
1556
- unsigned numInstructions = Opcodes.size ();
1557
1556
1558
- assert (numInstructions && " Filter created with no instructions" );
1557
+ assert (!Opcodes. empty () && " Filter created with no instructions" );
1559
1558
1560
1559
// No further filtering is necessary.
1561
- if (numInstructions == 1 )
1560
+ if (Opcodes. size () == 1 )
1562
1561
return true ;
1563
1562
1564
1563
// Heuristics. See also doFilter()'s "Heuristics" comment when num of
1565
1564
// instructions is 3.
1566
1565
if (AllowMixed && !Greedy) {
1567
- assert (numInstructions == 3 );
1566
+ assert (Opcodes. size () == 3 );
1568
1567
1569
1568
for (const auto &Opcode : Opcodes) {
1570
1569
insn_t Insn = insnWithID (Opcode.EncodingID );
@@ -1771,8 +1770,7 @@ bool FilterChooser::filterProcessor(bool AllowMixed, bool Greedy) {
1771
1770
// the instructions. A conflict of instructions may occur, in which case we
1772
1771
// dump the conflict set to the standard error.
1773
1772
void FilterChooser::doFilter () {
1774
- unsigned Num = Opcodes.size ();
1775
- assert (Num && " FilterChooser created with no instructions" );
1773
+ assert (!Opcodes.empty () && " FilterChooser created with no instructions" );
1776
1774
1777
1775
// Try regions of consecutive known bit values first.
1778
1776
if (filterProcessor (false ))
@@ -1786,7 +1784,7 @@ void FilterChooser::doFilter() {
1786
1784
// no single instruction for the maximum ATTR_MIXED region Inst{14-4} has a
1787
1785
// well-known encoding pattern. In such case, we backtrack and scan for the
1788
1786
// the very first consecutive ATTR_ALL_SET region and assign a filter to it.
1789
- if (Num == 3 && filterProcessor (true , false ))
1787
+ if (Opcodes. size () == 3 && filterProcessor (true , false ))
1790
1788
return ;
1791
1789
1792
1790
// If we come to here, the instruction decoding has failed.
0 commit comments