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 {