[llvm-commits] [llvm] r164035 - /llvm/trunk/lib/Transforms/Scalar/SROA.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Sep 17 09:42:37 PDT 2012
Author: d0k
Date: Mon Sep 17 11:42:36 2012
New Revision: 164035
URL: http://llvm.org/viewvc/llvm-project?rev=164035&view=rev
Log:
NewSROA: Provide a full set of operator< for ByteRanges.
MSVC8 won't compile lower_bound if one is missing.
Modified:
llvm/trunk/lib/Transforms/Scalar/SROA.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=164035&r1=164034&r2=164035&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Mon Sep 17 11:42:36 2012
@@ -110,8 +110,13 @@
}
/// \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 {
More information about the llvm-commits
mailing list