LLVM: include/llvm/CodeGen/DbgEntityHistoryCalculator.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_CODEGEN_DBGENTITYHISTORYCALCULATOR_H

10#define LLVM_CODEGEN_DBGENTITYHISTORYCALCULATOR_H

11

16#include

17

18namespace llvm {

19

25

26

27

28

29

31public:

33 void clear() { InstNumberMap.clear(); }

34

35

36

38

39private:

40

42};

43

44

45

47public:

48

50

51

52

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

73 friend DbgValueHistoryMap;

74

75 public:

77

79 : Instr(Instr, Kind), EndIndex(NoEntry) {}

80

84

88

90

91 private:

94 };

96 using InlinedEntity = std::pair<const DINode *, const DILocation *>;

98

99private:

101

102public:

106

108 auto &Entries = VarEntries[Var];

110 }

111

112

113

115

116

119 bool empty() const { return VarEntries.empty(); }

120 void clear() { VarEntries.clear(); }

123

124#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

126#endif

127};

128

129

130

131

133public:

134 using InlinedEntity = std::pair<const DINode *, const DILocation *>;

136

137private:

139

140public:

142

143 bool empty() const { return LabelInstr.empty(); }

144 void clear() { LabelInstr.clear(); }

147};

148

150 const TargetRegisterInfo *TRI,

151 DbgValueHistoryMap &DbgValues,

152 DbgLabelInstrMap &DbgLabels);

153

154}

155

156#endif

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

#define LLVM_DUMP_METHOD

Mark debug helper function definitions like dump() that should not be stripped from debug builds.

Register const TargetRegisterInfo * TRI

This file implements a map that provides insertion order iteration.

This file defines the PointerIntPair class.

This file defines the SmallVector class.

Tagged DWARF-like metadata node.

For each inlined instance of a source-level label, keep the corresponding DBG_LABEL instruction.

Definition DbgEntityHistoryCalculator.h:132

InstrMap::const_iterator end() const

Definition DbgEntityHistoryCalculator.h:146

std::pair< const DINode *, const DILocation * > InlinedEntity

Definition DbgEntityHistoryCalculator.h:134

MapVector< InlinedEntity, const MachineInstr * > InstrMap

Definition DbgEntityHistoryCalculator.h:135

bool empty() const

Definition DbgEntityHistoryCalculator.h:143

void addInstr(InlinedEntity Label, const MachineInstr &MI)

InstrMap::const_iterator begin() const

Definition DbgEntityHistoryCalculator.h:145

void clear()

Definition DbgEntityHistoryCalculator.h:144

Specifies a change in a variable's debug value history.

Definition DbgEntityHistoryCalculator.h:72

const MachineInstr * getInstr() const

Definition DbgEntityHistoryCalculator.h:81

bool isClosed() const

Definition DbgEntityHistoryCalculator.h:87

bool isClobber() const

Definition DbgEntityHistoryCalculator.h:85

Entry(const MachineInstr *Instr, EntryKind Kind)

Definition DbgEntityHistoryCalculator.h:78

EntryKind

Definition DbgEntityHistoryCalculator.h:76

@ Clobber

Definition DbgEntityHistoryCalculator.h:76

@ DbgValue

Definition DbgEntityHistoryCalculator.h:76

EntryIndex getEndIndex() const

Definition DbgEntityHistoryCalculator.h:82

EntryKind getEntryKind() const

Definition DbgEntityHistoryCalculator.h:83

void endEntry(EntryIndex EndIndex)

bool isDbgValue() const

Definition DbgEntityHistoryCalculator.h:86

For each user variable, keep a list of instruction ranges where this variable is accessible.

Definition DbgEntityHistoryCalculator.h:46

bool startDbgValue(InlinedEntity Var, const MachineInstr &MI, EntryIndex &NewIndex)

void trimLocationRanges(const MachineFunction &MF, LexicalScopes &LScopes, const InstructionOrdering &Ordering)

Drop location ranges which exist entirely outside each variable's scope.

MapVector< InlinedEntity, Entries > EntriesMap

Definition DbgEntityHistoryCalculator.h:97

size_t EntryIndex

Index in the entry vector.

Definition DbgEntityHistoryCalculator.h:49

EntryIndex startClobber(InlinedEntity Var, const MachineInstr &MI)

void clear()

Definition DbgEntityHistoryCalculator.h:120

EntriesMap::const_iterator begin() const

Definition DbgEntityHistoryCalculator.h:121

SmallVector< Entry, 4 > Entries

Definition DbgEntityHistoryCalculator.h:95

EntriesMap::const_iterator end() const

Definition DbgEntityHistoryCalculator.h:122

Entry & getEntry(InlinedEntity Var, EntryIndex Index)

Definition DbgEntityHistoryCalculator.h:107

bool empty() const

Definition DbgEntityHistoryCalculator.h:119

LLVM_DUMP_METHOD void dump(StringRef FuncName) const

static const EntryIndex NoEntry

Special value to indicate that an entry is valid until the end of the function.

Definition DbgEntityHistoryCalculator.h:53

bool hasNonEmptyLocation(const Entries &Entries) const

Test whether a vector of entries features any non-empty locations.

std::pair< const DINode *, const DILocation * > InlinedEntity

Definition DbgEntityHistoryCalculator.h:96

Record instruction ordering so we can query their relative positions within a function.

Definition DbgEntityHistoryCalculator.h:30

void clear()

Definition DbgEntityHistoryCalculator.h:33

void initialize(const MachineFunction &MF)

bool isBefore(const MachineInstr *A, const MachineInstr *B) const

Check if instruction A comes before B, where A and B both belong to the MachineFunction passed to ini...

This class provides interface to collect and use lexical scoping information from machine instruction...

Representation of each machine instruction.

This class implements a map that also provides access to all stored values in a deterministic order.

typename SmallVector< std::pair< InlinedEntity, Entries >, 0 >::const_iterator const_iterator

PointerIntPair - This class implements a pair of a pointer and small integer.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

StringRef - Represent a constant reference to a string, i.e.

TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...

This is an optimization pass for GlobalISel generic memory operations.

void calculateDbgEntityHistory(const MachineFunction *MF, const TargetRegisterInfo *TRI, DbgValueHistoryMap &DbgValues, DbgLabelInstrMap &DbgLabels)