20#define DEBUG_TYPE "Sort"
28 return std::string(LHS->kind()) < std::string(RHS->kind());
34 return LHS->getLineNumber() < RHS->getLineNumber();
40 return LHS->getName() < RHS->getName();
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(
69 LHS->kind(), LHS->getName(), LHS->getLineNumber(), LHS->getOffset());
70 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Right(
71 RHS->kind(), RHS->getName(), RHS->getLineNumber(), RHS->getOffset());
80 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Left(
81 LHS->getLineNumber(), LHS->getName(), LHS->kind(), LHS->getOffset());
82 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Right(
83 RHS->getLineNumber(), RHS->getName(), RHS->kind(), RHS->getOffset());
92 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Left(
93 LHS->getName(), LHS->getLineNumber(), LHS->kind(), LHS->getOffset());
94 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Right(
95 RHS->getName(), RHS->getLineNumber(), RHS->kind(), RHS->getOffset());
100 using LVSortInfo = std::map<LVSortMode, LVSortFunction>;
101 static LVSortInfo SortInfo = {
108 LVSortInfo::iterator Iter = SortInfo.find(
options().getSortMode());
109 if (Iter != SortInfo.end())
110 SortFunction = Iter->second;
LLVM_ABI LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortValue compareName(const LVObject *LHS, const LVObject *RHS)
LVSortValue(*)(const LVObject *LHS, const LVObject *RHS) LVSortFunction
LLVM_ABI LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS)
LLVM_ABI LVSortFunction getSortFunction()
LLVM_ABI LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS)
This is an optimization pass for GlobalISel generic memory operations.