LLVM: lib/DebugInfo/LogicalView/Core/LVSort.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

15#include

16

17using namespace llvm;

19

20#define DEBUG_TYPE "Sort"

21

22

23

24

25

28 return LHS->getID() < RHS->getID();

29}

30

31

34 return std::string(LHS->kind()) < std::string(RHS->kind());

35}

36

37

40 return LHS->getLineNumber() < RHS->getLineNumber();

41}

42

43

46 return LHS->getName() < RHS->getName();

47}

48

49

52 return LHS->getOffset() < RHS->getOffset();

53}

54

55

58 if (LHS->getLowerAddress() < RHS->getLowerAddress())

59 return true;

60

61

62

63 if (LHS->getLowerAddress() == RHS->getLowerAddress())

64 return LHS->getUpperAddress() < RHS->getUpperAddress();

65

66 return false;

67}

68

69

72

73

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());

79}

80

81

84

85

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());

91}

92

93

96

97

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());

103}

104

106 using LVSortInfo = std::map<LVSortMode, LVSortFunction>;

107 static LVSortInfo SortInfo = {

111 };

112

114 LVSortInfo::iterator Iter = SortInfo.find(options().getSortMode());

115 if (Iter != SortInfo.end())

116 SortFunction = Iter->second;

117 return SortFunction;

118}

LLVM_ABI LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:94

LLVM_ABI LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:50

LLVM_ABI LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:82

LLVM_ABI LVSortValue compareID(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:26

LLVM_ABI LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:70

LLVM_ABI LVSortValue compareName(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:44

LVSortValue(*)(const LVObject *LHS, const LVObject *RHS) LVSortFunction

LLVM_ABI LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:56

LLVM_ABI LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:38

LLVM_ABI LVSortFunction getSortFunction()

Definition LVSort.cpp:105

LLVM_ABI LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS)

Definition LVSort.cpp:32

This is an optimization pass for GlobalISel generic memory operations.