summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-17 17:45:15 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-17 17:45:15 +0000
commit2784a339abc5537326a15613bd2de40a577d5ccf (patch)
tree24b83d0ab93ed72a168b827d0d1d00badb3f1719
parent72024ad7afb4f3361a21307025d6d1719d6462c0 (diff)
downloadbcm5719-llvm-2784a339abc5537326a15613bd2de40a577d5ccf.tar.gz
bcm5719-llvm-2784a339abc5537326a15613bd2de40a577d5ccf.zip
[TableGen] Don't separately search for DefaultMode when we're going to iterate the set anyway. NFCI.
llvm-svn: 340055
-rw-r--r--llvm/utils/TableGen/InfoByHwMode.h4
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;
OpenPOWER on IntegriCloud