diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-09-21 18:24:30 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-09-21 18:24:30 +0000 |
commit | 25a123df8553de99a89d8190b129b983892a2dd7 (patch) | |
tree | abad5fd47f33092f77a5ad0a8a6bf8b8a8bb4803 /llvm/lib/CodeGen/LiveInterval.cpp | |
parent | 5549d496ddca4913a3bb8c7c49c0c4823166ce17 (diff) | |
download | bcm5719-llvm-25a123df8553de99a89d8190b129b983892a2dd7.tar.gz bcm5719-llvm-25a123df8553de99a89d8190b129b983892a2dd7.zip |
MSVC9 does not support upper_bound with an asymmetric comparator.
llvm-svn: 114455
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index 6a6ecf78f68..199e5000b60 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -30,14 +30,18 @@ #include <algorithm> using namespace llvm; -// compEnd - Compare LiveRange end to Pos. -// This argument ordering works for upper_bound. -static inline bool compEnd(SlotIndex Pos, const LiveRange &LR) { - return Pos < LR.end; -} +// CompEnd - Compare LiveRange end to Pos. +struct CompEnd { + bool operator()(SlotIndex Pos, const LiveRange &LR) const { + return Pos < LR.end; + } + bool operator()(const LiveRange &LR, SlotIndex Pos) const { + return LR.end < Pos; + } +}; LiveInterval::iterator LiveInterval::find(SlotIndex Pos) { - return std::upper_bound(begin(), end(), Pos, compEnd); + return std::upper_bound(begin(), end(), Pos, CompEnd()); } /// killedInRange - Return true if the interval has kills in [Start,End). |