That's it, I am declaring this a failure of the C++03 STL.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 12 Mar 2011 01:50:35 +0000 (01:50 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 12 Mar 2011 01:50:35 +0000 (01:50 +0000)
commit55768d763d3d955c07d5819c3ef2e9d1ca6d2baf
tree9ba913d3af1620e2a8e39ca7efe300c51f19a677
parent8b3000b08ee583bedfa8baebd4fcfd92e9a201c7
That's it, I am declaring this a failure of the C++03 STL.

There are too many compatibility problems with using mixed types in
std::upper_bound, and I don't want to spend 110 lines of boilerplate setting up
a call to a 10-line function. Binary search is not /that/ hard to implement
correctly.

I tried terminating the binary search with a linear search, but that actually
made the algorithm slower against my expectation. Most live intervals have less
than 4 segments. The early test against endIndex() does pay, and this version is
25% faster than plain std::upper_bound().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127522 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveInterval.cpp