diff options
-rw-r--r-- | llvm/utils/TableGen/InfoByHwMode.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/InfoByHwMode.h b/llvm/utils/TableGen/InfoByHwMode.h index 4838198e704..7be4678f271 100644 --- a/llvm/utils/TableGen/InfoByHwMode.h +++ b/llvm/utils/TableGen/InfoByHwMode.h @@ -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; |