forked from OSchip/llvm-project
[TableGen] Remove local SmallSet from TypeSetByHwMode::insert.
This keeps track of which modes are in VVT so we can find out if a mode is missing later. But we can just ask VVT whether it has a particular mode.
This commit is contained in:
parent
21bef4e11e
commit
a5e579cc2b
|
@ -111,10 +111,8 @@ bool TypeSetByHwMode::insert(const ValueTypeByHwMode &VVT) {
|
|||
bool ContainsDefault = false;
|
||||
MVT DT = MVT::Other;
|
||||
|
||||
SmallSet<unsigned, 4> Modes;
|
||||
for (const auto &P : VVT) {
|
||||
unsigned M = P.first;
|
||||
Modes.insert(M);
|
||||
// Make sure there exists a set for each specific mode from VVT.
|
||||
Changed |= getOrCreate(M).insert(P.second).second;
|
||||
// Cache VVT's default mode.
|
||||
|
@ -128,7 +126,7 @@ bool TypeSetByHwMode::insert(const ValueTypeByHwMode &VVT) {
|
|||
// modes in "this" that do not exist in VVT.
|
||||
if (ContainsDefault)
|
||||
for (auto &I : *this)
|
||||
if (!Modes.count(I.first))
|
||||
if (!VVT.hasMode(I.first))
|
||||
Changed |= I.second.insert(DT).second;
|
||||
|
||||
return Changed;
|
||||
|
|
Loading…
Reference in New Issue