From 4f7721c0050b92ef2560ac25aa84e445afc83baf Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 17 Sep 2012 16:42:36 +0000 Subject: [PATCH] NewSROA: Provide a full set of operator< for ByteRanges. MSVC8 won't compile lower_bound if one is missing. llvm-svn: 164035 --- lib/Transforms/Scalar/SROA.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index daf99fb4f2d..a7d8ee7e68b 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -110,8 +110,13 @@ public: } /// \brief Support comparison with a single offset to allow binary searches. - bool operator<(uint64_t RHSOffset) const { - return BeginOffset < RHSOffset; + friend bool operator<(const ByteRange &LHS, uint64_t RHSOffset) { + return LHS.BeginOffset < RHSOffset; + } + + friend LLVM_ATTRIBUTE_UNUSED bool operator<(uint64_t LHSOffset, + const ByteRange &RHS) { + return LHSOffset < RHS.BeginOffset; } bool operator==(const ByteRange &RHS) const {