[llvm] [BOLT] Use *Set::insert_range (NFC) (PR #133601)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 29 15:06:33 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133601
None
>From 353dda882725086ed91236136458244c39ccc7c8 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 29 Mar 2025 14:28:10 -0700
Subject: [PATCH] [BOLT] Use *Set::insert_range (NFC)
---
bolt/include/bolt/Passes/DominatorAnalysis.h | 2 +-
bolt/lib/Core/BinaryFunction.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bolt/include/bolt/Passes/DominatorAnalysis.h b/bolt/include/bolt/Passes/DominatorAnalysis.h
index 3f3afa943c06c..8eb470693bf10 100644
--- a/bolt/include/bolt/Passes/DominatorAnalysis.h
+++ b/bolt/include/bolt/Passes/DominatorAnalysis.h
@@ -54,7 +54,7 @@ class DominatorAnalysis
HasNonDominatedPred = true;
});
if (HasDominatedPred && HasNonDominatedPred)
- Result.insert(Candidates.begin(), Candidates.end());
+ Result.insert_range(Candidates);
if ((*this->getStateAt(ProgramPoint::getLastPointAt(BB)))[DomIdx] &&
BB.succ_begin() == BB.succ_end())
Result.insert(ProgramPoint::getLastPointAt(BB));
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 5ee33f52ec88a..09006249887f6 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -1997,7 +1997,7 @@ void BinaryFunction::postProcessJumpTables() {
bool BinaryFunction::validateExternallyReferencedOffsets() {
SmallPtrSet<MCSymbol *, 4> JTTargets;
for (const JumpTable *JT : llvm::make_second_range(JumpTables))
- JTTargets.insert(JT->Entries.begin(), JT->Entries.end());
+ JTTargets.insert_range(JT->Entries);
bool HasUnclaimedReference = false;
for (uint64_t Destination : ExternallyReferencedOffsets) {
More information about the llvm-commits
mailing list