Skip to content

Commit 8370ac8

Browse files
committed
[TableGen] Remove push_back from loop. NFC
We can initialize the vector to the right size and then assign over some entries in the loop.
1 parent 61efe36 commit 8370ac8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,16 +1604,14 @@ bool FilterChooser::filterProcessor(bool AllowMixed, bool Greedy) {
16041604
// (MIXED) ------ . ----> (MIXED)
16051605
// (FILTERED)---- . ----> (FILTERED)
16061606

1607-
std::vector<bitAttr_t> bitAttrs;
1607+
std::vector<bitAttr_t> bitAttrs(BitWidth, ATTR_NONE);
16081608

16091609
// FILTERED bit positions provide no entropy and are not worthy of pursuing.
16101610
// Filter::recurse() set either BIT_TRUE or BIT_FALSE for each position.
16111611
for (BitIndex = 0; BitIndex < BitWidth; ++BitIndex)
16121612
if (FilterBitValues[BitIndex] == BIT_TRUE ||
16131613
FilterBitValues[BitIndex] == BIT_FALSE)
1614-
bitAttrs.push_back(ATTR_FILTERED);
1615-
else
1616-
bitAttrs.push_back(ATTR_NONE);
1614+
bitAttrs[BitIndex] = ATTR_FILTERED;
16171615

16181616
for (const auto &OpcPair : Opcodes) {
16191617
insn_t insn;

0 commit comments

Comments
 (0)