20#define DEBUG_TYPE "Sort"
28 return std::string(
LHS->kind()) < std::string(
RHS->kind());
34 return LHS->getLineNumber() <
RHS->getLineNumber();
46 return LHS->getOffset() <
RHS->getOffset();
52 if (
LHS->getLowerAddress() <
RHS->getLowerAddress())
57 if (
LHS->getLowerAddress() ==
RHS->getLowerAddress())
58 return LHS->getUpperAddress() <
RHS->getUpperAddress();
68 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Left(
70 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Right(
80 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Left(
82 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Right(
92 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Left(
94 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Right(
100 using LVSortInfo = std::map<LVSortMode, LVSortFunction>;
101 static LVSortInfo SortInfo = {
102 {LVSortMode::None,
nullptr}, {LVSortMode::Kind,
sortByKind},
108 LVSortInfo::iterator Iter = SortInfo.find(
options().getSortMode());
109 if (Iter != SortInfo.end())
110 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.