VS2005 patches

In the VS2005 debug std libraries, the lower_bound algorithm uses a
function known as _DEBUG_LT. The problem with this is that it asserts
that if a < b then !(b < a). It also asserts that the input is actually
sorted by using < to compare the elements.

In LLVM there are a couple of places where the lower_bound algorithm is
used with a lower bound of a different type than the iterators. It seems
to me upon checking the relevant parts of the ISO C++ standard (25.3 Sorting
and related operations) that MS are within their rights to make these
requirements on the < operator, although it's pretty annoying.

There are three possible solutions (in order of preference):

1) when the problem occurs because implicit conversion fails when the
     operator< is a class member and you switch the arguments, make an
     explicit conversion of the lower bound value.
2) to provide another operator< that provides the necessary comparision
     for _DEBUG_LT to work
3) change code that looks for a lower bound of a different type to look
     for a lower bound of the same type as the iterators

I used 1) in CorrelatedExprs
I used 2) in LiveInterval, X86FloatingPoint
I used 3) in SubTargetFeature

JIT.patch (842 Bytes)

bounds.patch (4.47 KB)

vcproj.patch (2.38 KB)