LLVM: lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36#define DEBUG_TYPE "livedebugvalues"
37
38using namespace llvm;
39
42 cl::desc("Use instruction-ref based LiveDebugValues with "
43 "normal DBG_VALUE inputs"),
45
47 "experimental-debug-variable-locations",
48 cl::desc("Use experimental new value-tracking variable locations"));
49
50
51
53 "livedebugvalues-input-bb-limit",
54 cl::desc("Maximum input basic blocks before DBG_VALUE limit applies"),
57 "livedebugvalues-input-dbg-value-limit",
59 "Maximum input DBG_VALUE insts supported by debug range extension"),
61
62namespace {
63
64
65
67public:
68 static char ID;
69
72
73
75
79 }
80
81private:
82 std::unique_ptr InstrRefImpl;
83 std::unique_ptr VarLocImpl;
86};
87}
88
90
92
94 false)
95
96
99 InstrRefImpl =
102}
103
104bool LiveDebugValues::runOnMachineFunction(MachineFunction &MF) {
106
108
109 TPC = getAnalysisIfAvailable();
110 LDVImpl *TheImpl = &*VarLocImpl;
111
113 if (InstrRefBased) {
114 DomTree = &MDT;
116 TheImpl = &*InstrRefImpl;
117 }
118
121}
122
124
127 return true;
128
129
131}
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.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
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.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
bool useDebugInstrRef() const
Returns true if the function's variable locations are tracked with instruction referencing.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Target-Independent Code Generator Pass Configuration Options.
Triple - Helper class for working with autoconf configuration names.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void initializeLiveDebugValuesPass(PassRegistry &)
LDVImpl * makeInstrRefBasedLiveDebugValues()
char & LiveDebugValuesID
LiveDebugValues pass.
LDVImpl * makeVarLocBasedLiveDebugValues()
bool debuginfoShouldUseDebugInstrRef(const Triple &T)