[llvm] [BOLT] Use llvm::upper_bound (NFC) (PR #140174)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu May 15 18:51:12 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/140174
None
>From 4068cc4b6609b53867e96f84d350c452b13e1249 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 15 May 2025 18:49:06 -0700
Subject: [PATCH] [BOLT] Use llvm::upper_bound (NFC)
---
bolt/lib/Core/DIEBuilder.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/bolt/lib/Core/DIEBuilder.cpp b/bolt/lib/Core/DIEBuilder.cpp
index 136c23d50df64..072a152119ae2 100644
--- a/bolt/lib/Core/DIEBuilder.cpp
+++ b/bolt/lib/Core/DIEBuilder.cpp
@@ -437,10 +437,10 @@ getUnitForOffset(DIEBuilder &Builder, DWARFContext &DWCtx,
// This is a work around for XCode clang. There is a build error when we
// pass DWCtx.compile_units() to llvm::upper_bound
std::call_once(InitVectorFlag, initCUVector);
- auto CUIter = std::upper_bound(CUOffsets.begin(), CUOffsets.end(), Offset,
- [](uint64_t LHS, const DWARFUnit *RHS) {
- return LHS < RHS->getNextUnitOffset();
- });
+ auto CUIter = llvm::upper_bound(CUOffsets, Offset,
+ [](uint64_t LHS, const DWARFUnit *RHS) {
+ return LHS < RHS->getNextUnitOffset();
+ });
CU = CUIter != CUOffsets.end() ? (*CUIter) : nullptr;
}
return CU;
More information about the llvm-commits
mailing list