1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[TableGen] Don't separately search for DefaultMode when we're going to iterate the set anyway. NFCI.

llvm-svn: 340055
This commit is contained in:
Simon Pilgrim 2018-08-17 17:45:15 +00:00
parent 20df8d1370
commit be9ad6ba34

View File

@ -47,10 +47,12 @@ std::vector<unsigned> union_modes(const InfoByHwMode<InfoT> &A,
for (const auto &P : B)
U.insert(P.first);
// Make sure that the default mode is last on the list.
bool HasDefault = U.count(DefaultMode);
bool HasDefault = false;
for (unsigned M : U)
if (M != DefaultMode)
V.push_back(M);
else
HasDefault = true;
if (HasDefault)
V.push_back(DefaultMode);
return V;