summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-07-03 08:13:17 +0000
committerFangrui Song <maskray@google.com>2019-07-03 08:13:17 +0000
commit7264a474b7c808e7d3cf44a4e7c0142281ca3cdf (patch)
treefba8d3c60cf164de08531ba93d8e96b115605e86 /clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
parent1f6d9845d8f2e0e664b0b03488588010adf39b3f (diff)
downloadbcm5719-llvm-7264a474b7c808e7d3cf44a4e7c0142281ca3cdf.tar.gz
bcm5719-llvm-7264a474b7c808e7d3cf44a4e7c0142281ca3cdf.zip
Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or llvm::partition_point. NFC
llvm-svn: 365006
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
index 09f2fd635b6..0aa410de15f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
@@ -274,15 +274,13 @@ public:
long long CurAlignmentBits = 1ull << (std::min)(TrailingZeros, 62u);
CharUnits CurAlignment = CharUnits::fromQuantity(CurAlignmentBits);
FieldInfo InsertPoint = {CurAlignment, CharUnits::Zero(), nullptr};
- auto CurBegin = Fields.begin();
- auto CurEnd = Fields.end();
// In the typical case, this will find the last element
// of the vector. We won't find a middle element unless
// we started on a poorly aligned address or have an overly
// aligned field.
- auto Iter = std::upper_bound(CurBegin, CurEnd, InsertPoint);
- if (Iter != CurBegin) {
+ auto Iter = llvm::upper_bound(Fields, InsertPoint);
+ if (Iter != Fields.begin()) {
// We found a field that we can layout with the current alignment.
--Iter;
NewOffset += Iter->Size;
OpenPOWER on IntegriCloud