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 | e43bde73aabc8f85ec9100362e38a43aef2512d4 (patch) | |
tree | dd6507c4b674c8553ff2881a08ac8be0f1f910fd /llvm | |
parent | 5b6411591c64a16abe3ce1946334284b078c7f97 (diff) | |
download | bcm5719-llvm-e43bde73aabc8f85ec9100362e38a43aef2512d4.tar.gz bcm5719-llvm-e43bde73aabc8f85ec9100362e38a43aef2512d4.zip |
Implement DwarfLLVMRegPair::operator< without violating asymmetry.
MSVC8 verifies this.
llvm-svn: 154002
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/MC/MCRegisterInfo.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h index 71bdef28363..27acf2f2cc2 100644 --- a/llvm/include/llvm/MC/MCRegisterInfo.h +++ b/llvm/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; } |