diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 24b03a058981a..89b20978c40e6 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -202,15 +202,9 @@ class RelocationValueRef { IsStubThumb == Other.IsStubThumb; } inline bool operator<(const RelocationValueRef &Other) const { - if (SectionID != Other.SectionID) - return SectionID < Other.SectionID; - if (Offset != Other.Offset) - return Offset < Other.Offset; - if (Addend != Other.Addend) - return Addend < Other.Addend; - if (IsStubThumb != Other.IsStubThumb) - return IsStubThumb < Other.IsStubThumb; - return SymbolName < Other.SymbolName; + return std::tie(SectionID, Offset, Addend, IsStubThumb, SymbolName) < + std::tie(Other.SectionID, Other.Offset, Other.Addend, + Other.IsStubThumb, Other.SymbolName); } }; diff --git a/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp b/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp index f38e7b879e5f0..5dde47ab3de57 100644 --- a/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp +++ b/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp @@ -253,7 +253,7 @@ namespace { bool operator!=(Register R) const { return !operator==(R); } bool operator<(Register R) const { // For std::map. - return Reg < R.Reg || (Reg == R.Reg && Sub < R.Sub); + return std::tie(Reg, Sub) < std::tie(R.Reg, R.Sub); } llvm::Register Reg; unsigned Sub = 0; @@ -298,11 +298,7 @@ namespace { return !operator==(Ex); } bool operator<(const ExtExpr &Ex) const { - if (Rs != Ex.Rs) - return Rs < Ex.Rs; - if (S != Ex.S) - return S < Ex.S; - return !Neg && Ex.Neg; + return std::tie(Rs, S, Neg) < std::tie(Ex.Rs, Ex.S, Ex.Neg); } };