[BOLT] Use llvm::upper_bound (NFC) (#140174)

This commit is contained in:
Kazu Hirata
2025-05-15 23:29:37 -07:00
committed by GitHub
parent 5ca94f92fb
commit a83668c3dd

View File

@@ -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;