21#define DEBUG_TYPE "Sort"
29 return std::string(
LHS->kind()) < std::string(
RHS->kind());
35 return LHS->getLineNumber() <
RHS->getLineNumber();
47 return LHS->getOffset() <
RHS->getOffset();
53 if (
LHS->getLowerAddress() <
RHS->getLowerAddress())
58 if (
LHS->getLowerAddress() ==
RHS->getLowerAddress())
59 return LHS->getUpperAddress() <
RHS->getUpperAddress();
69 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Left(
71 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Right(
81 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Left(
83 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Right(
93 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Left(
95 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Right(
101 using LVSortInfo = std::map<LVSortMode, LVSortFunction>;
102 static LVSortInfo SortInfo = {
103 {LVSortMode::None,
nullptr}, {LVSortMode::Kind,
sortByKind},
109 LVSortInfo::iterator Iter = SortInfo.find(
options().getSortMode());
110 if (Iter != SortInfo.end())
111 SortFunction = Iter->second;
StringRef getName() const
Return a constant reference to the value's name.
LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS)
LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS)
LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS)
LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS)
LVSortValue compareName(const LVObject *LHS, const LVObject *RHS)
LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS)
LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS)
LVSortFunction getSortFunction()
LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS)
LVSortValue(*)(const LVObject *LHS, const LVObject *RHS) LVSortFunction
This is an optimization pass for GlobalISel generic memory operations.