llvm.org GIT mirror llvm / 32d1774
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 Benjamin Kramer 8 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
133133 unsigned FromReg;
134134 unsigned ToReg;
135135
136 bool operator==(unsigned Reg) const { return FromReg == Reg; }
137 bool operator<(unsigned Reg) const { return FromReg < Reg; }
136 bool operator<(DwarfLLVMRegPair RHS) const { return FromReg < RHS.FromReg; }
138137 };
139138 private:
140139 const MCRegisterDesc *Desc; // Pointer to the descriptor array
314313 const DwarfLLVMRegPair *M = isEH ? EHL2DwarfRegs : L2DwarfRegs;
315314 unsigned Size = isEH ? EHL2DwarfRegsSize : L2DwarfRegsSize;
316315
317 const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, RegNum);
316 DwarfLLVMRegPair Key = { RegNum, 0 };
317 const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, Key);
318318 if (I == M+Size || I->FromReg != RegNum)
319319 return -1;
320320 return I->ToReg;
326326 const DwarfLLVMRegPair *M = isEH ? EHDwarf2LRegs : Dwarf2LRegs;
327327 unsigned Size = isEH ? EHDwarf2LRegsSize : Dwarf2LRegsSize;
328328
329 const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, RegNum);
329 DwarfLLVMRegPair Key = { RegNum, 0 };
330 const DwarfLLVMRegPair *I = std::lower_bound(M, M+Size, Key);
330331 assert(I != M+Size && I->FromReg == RegNum && "Invalid RegNum");
331332 return I->ToReg;
332333 }