aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-27 20:44:20 -0700
committerGitHub <noreply@github.com>2025-03-27 20:44:20 -0700
commit673f4705a827aba52b991d446a90a1c0ca5641a5 (patch)
treef45821848e00931f83d7432c90f0dff843fe519b /llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
parentc9197b27b484713c312c16cad12f9b518c1323c5 (diff)
downloadllvm-673f4705a827aba52b991d446a90a1c0ca5641a5.zip
llvm-673f4705a827aba52b991d446a90a1c0ca5641a5.tar.gz
llvm-673f4705a827aba52b991d446a90a1c0ca5641a5.tar.bz2
[llvm] Use *Set::insert_range (NFC) (#133353)
We can use *Set::insert_range to collapse: for (auto Elem : Range) Set.insert(E.first); down to: Set.insert_range(llvm::make_first_range(Range)); In some cases, we can further fold that into the set declaration.
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index e9a7153..5ee8c50 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -217,10 +217,8 @@ bool TypeSetByHwMode::operator==(const TypeSetByHwMode &VTS) const {
return false;
SmallSet<unsigned, 4> Modes;
- for (auto &I : *this)
- Modes.insert(I.first);
- for (const auto &I : VTS)
- Modes.insert(I.first);
+ Modes.insert_range(llvm::make_first_range(*this));
+ Modes.insert_range(llvm::make_first_range(VTS));
if (HaveDefault) {
// Both sets have default mode.