aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
index 8f697611a82c..141008ac2296 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -8,14 +8,16 @@
#include "LiveDebugValues.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/CodeGen/MachineDominators.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
+#include "llvm/PassRegistry.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetMachine.h"
/// \file LiveDebugValues.cpp
///
@@ -65,7 +67,7 @@ public:
static char ID;
LiveDebugValues();
- ~LiveDebugValues() {}
+ ~LiveDebugValues() = default;
/// Calculate the liveness information for the given machine function.
bool runOnMachineFunction(MachineFunction &MF) override;
@@ -123,6 +125,11 @@ bool LiveDebugValues::runOnMachineFunction(MachineFunction &MF) {
}
bool llvm::debuginfoShouldUseDebugInstrRef(const Triple &T) {
+ // Enable by default on x86_64, disable if explicitly turned off on cmdline.
+ if (T.getArch() == llvm::Triple::x86_64 &&
+ ValueTrackingVariableLocations != cl::boolOrDefault::BOU_FALSE)
+ return true;
+
// Enable if explicitly requested on command line.
return ValueTrackingVariableLocations == cl::boolOrDefault::BOU_TRUE;
}