Skip to content

Commit 3ef066f

Browse files
authored
[TableGen][DecoderEmitter] Change SmallSetVector to SetVector (NFC) (#159108)
SmallSetVector is too optimistic, there are usually more than 16 unique decoders and predicates. Modernize `typedef` to `using` while here.
1 parent ee66d96 commit 3ef066f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class LessEncodingIDByWidth {
160160
}
161161
};
162162

163-
typedef SmallSetVector<CachedHashString, 16> PredicateSet;
164-
typedef SmallSetVector<CachedHashString, 16> DecoderSet;
163+
using PredicateSet = SetVector<CachedHashString>;
164+
using DecoderSet = SetVector<CachedHashString>;
165165

166166
class DecoderTable {
167167
public:
@@ -274,7 +274,7 @@ class DecoderEmitter {
274274
void emitInstrLenTable(formatted_raw_ostream &OS,
275275
ArrayRef<unsigned> InstrLen) const;
276276
void emitPredicateFunction(formatted_raw_ostream &OS,
277-
PredicateSet &Predicates) const;
277+
const PredicateSet &Predicates) const;
278278
void emitDecoderFunction(formatted_raw_ostream &OS,
279279
const DecoderSet &Decoders,
280280
unsigned BucketBitWidth) const;
@@ -838,8 +838,8 @@ void DecoderEmitter::emitInstrLenTable(formatted_raw_ostream &OS,
838838
OS << "};\n\n";
839839
}
840840

841-
void DecoderEmitter::emitPredicateFunction(formatted_raw_ostream &OS,
842-
PredicateSet &Predicates) const {
841+
void DecoderEmitter::emitPredicateFunction(
842+
formatted_raw_ostream &OS, const PredicateSet &Predicates) const {
843843
// The predicate function is just a big switch statement based on the
844844
// input predicate index.
845845
OS << "static bool checkDecoderPredicate(unsigned Idx, const FeatureBitset "

0 commit comments

Comments
 (0)