diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-04-04 08:24:08 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-04-04 08:24:08 +0000 |
commit | 32d1774d45532508c9c76fa8e4dad9454ec50656 (patch) | |
tree | 20c8f4a4ac1ef973272a25c68c7a690d5afa6759 /include/llvm | |
parent | 58609b741301976a2ea3923f4c6494ba1c7e5439 (diff) | |
download | external_llvm-32d1774d45532508c9c76fa8e4dad9454ec50656.zip external_llvm-32d1774d45532508c9c76fa8e4dad9454ec50656.tar.gz external_llvm-32d1774d45532508c9c76fa8e4dad9454ec50656.tar.bz2 |
Implement DwarfLLVMRegPair::operator< without violating asymmetry.
MSVC8 verifies this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/MC/MCRegisterInfo.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index 71bdef2..27acf2f 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -134,8 +134,7 @@ public: unsigned FromReg; unsigned ToReg; - bool operator==(unsigned Reg) const { return FromReg == Reg; } - bool operator<(unsigned Reg) const { return FromReg < Reg; } + bool operator<(DwarfLLVMRegPair RHS) const { return FromReg < RHS.FromReg; } }; private: const MCRegisterDesc *Desc; // Pointer to the descriptor array @@ -315,7 +314,8 @@ public: const DwarfLLVMRegPair *M = isEH ? EHL2DwarfRegs : L2DwarfRegs; unsigned Size = isEH ? EHL2DwarfRegsSize : L2DwarfRegsSize; - const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, RegNum); + DwarfLLVMRegPair Key = { RegNum, 0 }; + const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, Key); if (I == M+Size || I->FromReg != RegNum) return -1; return I->ToReg; @@ -327,7 +327,8 @@ public: const DwarfLLVMRegPair *M = isEH ? EHDwarf2LRegs : Dwarf2LRegs; unsigned Size = isEH ? EHDwarf2LRegsSize : Dwarf2LRegsSize; - const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, RegNum); + DwarfLLVMRegPair Key = { RegNum, 0 }; + const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, Key); assert(I != M+Size && I->FromReg == RegNum && "Invalid RegNum"); return I->ToReg; } |