20#define DEBUG_TYPE "Sort"
28 return LHS->getID() < RHS->getID();
34 return std::string(LHS->kind()) < std::string(RHS->kind());
40 return LHS->getLineNumber() < RHS->getLineNumber();
46 return LHS->getName() < RHS->getName();
52 return LHS->getOffset() < RHS->getOffset();
58 if (LHS->getLowerAddress() < RHS->getLowerAddress())
63 if (LHS->getLowerAddress() == RHS->getLowerAddress())
64 return LHS->getUpperAddress() < RHS->getUpperAddress();
74 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Left(
75 LHS->kind(), LHS->getName(), LHS->getLineNumber(), LHS->getOffset());
76 std::tuple<std::string, StringRef, uint32_t, LVOffset>
Right(
77 RHS->kind(), RHS->getName(), RHS->getLineNumber(), RHS->getOffset());
86 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Left(
87 LHS->getLineNumber(), LHS->getName(), LHS->kind(), LHS->getOffset());
88 std::tuple<uint32_t, StringRef, std::string, LVOffset>
Right(
89 RHS->getLineNumber(), RHS->getName(), RHS->kind(), RHS->getOffset());
98 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Left(
99 LHS->getName(), LHS->getLineNumber(), LHS->kind(), LHS->getOffset());
100 std::tuple<StringRef, uint32_t, std::string, LVOffset>
Right(
101 RHS->getName(), RHS->getLineNumber(), RHS->kind(), RHS->getOffset());
106 using LVSortInfo = std::map<LVSortMode, LVSortFunction>;
107 static LVSortInfo SortInfo = {
114 LVSortInfo::iterator Iter = SortInfo.find(
options().getSortMode());
115 if (Iter != SortInfo.end())
116 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 compareID(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.