LLVM: lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#define DEBUG_TYPE "livedebugvalues"
38
39using namespace llvm;
40
43 cl::desc("Use instruction-ref based LiveDebugValues with "
44 "normal DBG_VALUE inputs"),
46
48 "experimental-debug-variable-locations",
49 cl::desc("Use experimental new value-tracking variable locations"));
50
51
52
54 "livedebugvalues-input-bb-limit",
55 cl::desc("Maximum input basic blocks before DBG_VALUE limit applies"),
58 "livedebugvalues-input-dbg-value-limit",
60 "Maximum input DBG_VALUE insts supported by debug range extension"),
62
63namespace {
64
65
66
68public:
69 static char ID;
70
71 LiveDebugValuesLegacy();
72 ~LiveDebugValuesLegacy() override = default;
73
74
76
77 void getAnalysisUsage(AnalysisUsage &AU) const override {
81 }
82};
83
85 LiveDebugValues();
86 ~LiveDebugValues() = default;
88
89private:
90 std::unique_ptr InstrRefImpl;
91 std::unique_ptr VarLocImpl;
93};
94}
95
96char LiveDebugValuesLegacy::ID = 0;
97
99
101 false, false)
102
103
106}
107
108LiveDebugValues::LiveDebugValues() {
109 InstrRefImpl =
112}
113
114PreservedAnalyses
123
126 OS << MapClassName2PassName(name());
127 if (ShouldEmitDebugEntryValues)
128 OS << "";
129}
130
131bool LiveDebugValuesLegacy::runOnMachineFunction(MachineFunction &MF) {
132 auto *TPC = &getAnalysis();
135}
136
138 bool ShouldEmitDebugEntryValues) {
140
142
143 LDVImpl *TheImpl = &*VarLocImpl;
144
146 if (InstrRefBased) {
147 DomTree = &MDT;
149 TheImpl = &*InstrRefImpl;
150 }
151
152 return TheImpl->ExtendRanges(MF, DomTree, ShouldEmitDebugEntryValues,
154}
155
157
160 return true;
161
162
164}
static cl::opt< unsigned > InputBBLimit("livedebugvalues-input-bb-limit", cl::desc("Maximum input basic blocks before DBG_VALUE limit applies"), cl::init(10000), cl::Hidden)
static cl::opt< bool > ForceInstrRefLDV("force-instr-ref-livedebugvalues", cl::Hidden, cl::desc("Use instruction-ref based LiveDebugValues with " "normal DBG_VALUE inputs"), cl::init(false))
static cl::opt< unsigned > InputDbgValueLimit("livedebugvalues-input-dbg-value-limit", cl::desc("Maximum input DBG_VALUE insts supported by debug range extension"), cl::init(50000), cl::Hidden)
static cl::opt< cl::boolOrDefault > ValueTrackingVariableLocations("experimental-debug-variable-locations", cl::desc("Use experimental new value-tracking variable locations"))
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Target-Independent Code Generator Pass Configuration Options pass.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Definition LiveDebugValues.cpp:115
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Definition LiveDebugValues.cpp:124
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool useDebugInstrRef() const
Returns true if the function's variable locations are tracked with instruction referencing.
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
LLVM_ABI bool ShouldEmitDebugEntryValues() const
NOTE: There are targets that still do not support the debug entry values production.
Target-Independent Code Generator Pass Configuration Options.
Triple - Helper class for working with autoconf configuration names.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
initializer< Ty > init(const Ty &Val)
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
This is an optimization pass for GlobalISel generic memory operations.
LDVImpl * makeInstrRefBasedLiveDebugValues()
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI char & LiveDebugValuesID
LiveDebugValues pass.
Definition LiveDebugValues.cpp:98
LLVM_ABI void initializeLiveDebugValuesLegacyPass(PassRegistry &)
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LDVImpl * makeVarLocBasedLiveDebugValues()
bool debuginfoShouldUseDebugInstrRef(const Triple &T)
Definition LiveDebugValues.cpp:156