aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2023-01-20 14:14:39 +0000
committerJeremy Morse <jeremy.morse@sony.com>2023-01-20 14:47:11 +0000
commit9f8544713ad8e57fb74cbfce3fbc7fff523e549f (patch)
treede08914a5da4340ab9c48402ba16ed87d1d13dd8 /llvm/lib/CodeGen/MachineFunction.cpp
parentbdf30603f28f5a97a63350e575e1b5cef052e7d0 (diff)
downloadllvm-9f8544713ad8e57fb74cbfce3fbc7fff523e549f.zip
llvm-9f8544713ad8e57fb74cbfce3fbc7fff523e549f.tar.gz
llvm-9f8544713ad8e57fb74cbfce3fbc7fff523e549f.tar.bz2
[DebugInfo] Store instr-ref mode of MachineFunction in member
Add a flag state (and a MIR key) to MachineFunctions indicating whether they contain instruction referencing debug-info or not. Whether DBG_VALUEs or DBG_INSTR_REFs are used needs to be determined by LiveDebugValues at least, and using the current optimisation level as a proxy is proving unreliable. Test updates are purely adding the flag to tests, in a couple of cases it involves separating out VarLocBasedLDV/InstrRefBasedLDV tests into separate files, as they can no longer share the same input. Differential Revision: https://reviews.llvm.org/D141387
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index a6fd3a8..59e6647 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -1195,7 +1195,7 @@ void MachineFunction::finalizeDebugInstrRefs() {
}
}
-bool MachineFunction::useDebugInstrRef() const {
+bool MachineFunction::shouldUseDebugInstrRef() const {
// Disable instr-ref at -O0: it's very slow (in compile time). We can still
// have optimized code inlined into this unoptimized code, however with
// fewer and less aggressive optimizations happening, coverage and accuracy
@@ -1213,6 +1213,14 @@ bool MachineFunction::useDebugInstrRef() const {
return false;
}
+bool MachineFunction::useDebugInstrRef() const {
+ return UseDebugInstrRef;
+}
+
+void MachineFunction::setUseDebugInstrRef(bool Use) {
+ UseDebugInstrRef = Use;
+}
+
// Use one million as a high / reserved number.
const unsigned MachineFunction::DebugOperandMemNumber = 1000000;