mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[C++11] Use std::tie to simplify compare operators.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -979,21 +979,11 @@ void Cost::Lose() {
|
||||
|
||||
/// operator< - Choose the lower cost.
|
||||
bool Cost::operator<(const Cost &Other) const {
|
||||
if (NumRegs != Other.NumRegs)
|
||||
return NumRegs < Other.NumRegs;
|
||||
if (AddRecCost != Other.AddRecCost)
|
||||
return AddRecCost < Other.AddRecCost;
|
||||
if (NumIVMuls != Other.NumIVMuls)
|
||||
return NumIVMuls < Other.NumIVMuls;
|
||||
if (NumBaseAdds != Other.NumBaseAdds)
|
||||
return NumBaseAdds < Other.NumBaseAdds;
|
||||
if (ScaleCost != Other.ScaleCost)
|
||||
return ScaleCost < Other.ScaleCost;
|
||||
if (ImmCost != Other.ImmCost)
|
||||
return ImmCost < Other.ImmCost;
|
||||
if (SetupCost != Other.SetupCost)
|
||||
return SetupCost < Other.SetupCost;
|
||||
return false;
|
||||
return std::tie(NumRegs, AddRecCost, NumIVMuls, NumBaseAdds, ScaleCost,
|
||||
ImmCost, SetupCost) <
|
||||
std::tie(Other.NumRegs, Other.AddRecCost, Other.NumIVMuls,
|
||||
Other.NumBaseAdds, Other.ScaleCost, Other.ImmCost,
|
||||
Other.SetupCost);
|
||||
}
|
||||
|
||||
void Cost::print(raw_ostream &OS) const {
|
||||
|
Reference in New Issue
Block a user