[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-08-25 Thread Jeremy Morse via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG121a49d839d7: [LiveDebugValues] Add switches for using 
instr-ref variable locations (authored by jmorse).

Changed prior to commit:
  https://reviews.llvm.org/D83048?vs=286814=287655#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83048/new/

https://reviews.llvm.org/D83048

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/debug-var-experimental-switch.c
  llvm/include/llvm/CodeGen/CommandFlags.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp

Index: llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
===
--- llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -14,6 +14,7 @@
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
+#include "llvm/Target/TargetMachine.h"
 
 /// \file LiveDebugValues.cpp
 ///
@@ -40,7 +41,10 @@
   static char ID;
 
   LiveDebugValues();
-  ~LiveDebugValues() { delete TheImpl; }
+  ~LiveDebugValues() {
+if (TheImpl)
+  delete TheImpl;
+  }
 
   /// Calculate the liveness information for the given machine function.
   bool runOnMachineFunction(MachineFunction ) override;
@@ -57,6 +61,7 @@
 
 private:
   LDVImpl *TheImpl;
+  TargetPassConfig *TPC;
 };
 
 char LiveDebugValues::ID = 0;
@@ -69,10 +74,24 @@
 /// Default construct and initialize the pass.
 LiveDebugValues::LiveDebugValues() : MachineFunctionPass(ID) {
   initializeLiveDebugValuesPass(*PassRegistry::getPassRegistry());
-  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  TheImpl = nullptr;
 }
 
 bool LiveDebugValues::runOnMachineFunction(MachineFunction ) {
-  auto *TPC = getAnalysisIfAvailable();
+  if (!TheImpl) {
+TPC = getAnalysisIfAvailable();
+
+bool InstrRefBased = false;
+if (TPC) {
+  auto  = TPC->getTM();
+  InstrRefBased = TM.Options.ValueTrackingVariableLocations;
+}
+
+if (InstrRefBased)
+  TheImpl = llvm::makeInstrRefBasedLiveDebugValues();
+else
+  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  }
+
   return TheImpl->ExtendRanges(MF, TPC);
 }
Index: llvm/lib/CodeGen/CommandFlags.cpp
===
--- llvm/lib/CodeGen/CommandFlags.cpp
+++ llvm/lib/CodeGen/CommandFlags.cpp
@@ -85,6 +85,7 @@
 CGOPT(bool, EnableAddrsig)
 CGOPT(bool, EmitCallSiteInfo)
 CGOPT(bool, EnableDebugEntryValues)
+CGOPT(bool, ValueTrackingVariableLocations)
 CGOPT(bool, ForceDwarfFrameSection)
 CGOPT(bool, XRayOmitFunctionIndex)
 
@@ -400,6 +401,12 @@
   cl::init(false));
   CGBINDOPT(EnableDebugEntryValues);
 
+  static cl::opt ValueTrackingVariableLocations(
+  "experimental-debug-variable-locations",
+  cl::desc("Use experimental new value-tracking variable locations"),
+  cl::init(false));
+  CGBINDOPT(ValueTrackingVariableLocations);
+
   static cl::opt ForceDwarfFrameSection(
   "force-dwarf-frame-section",
   cl::desc("Always emit a debug frame section."), cl::init(false));
@@ -475,6 +482,7 @@
   Options.EmitAddrsig = getEnableAddrsig();
   Options.EmitCallSiteInfo = getEmitCallSiteInfo();
   Options.EnableDebugEntryValues = getEnableDebugEntryValues();
+  Options.ValueTrackingVariableLocations = getValueTrackingVariableLocations();
   Options.ForceDwarfFrameSection = getForceDwarfFrameSection();
   Options.XRayOmitFunctionIndex = getXRayOmitFunctionIndex();
 
Index: llvm/include/llvm/Target/TargetOptions.h
===
--- llvm/include/llvm/Target/TargetOptions.h
+++ llvm/include/llvm/Target/TargetOptions.h
@@ -126,8 +126,8 @@
   EmitStackSizeSection(false), EnableMachineOutliner(false),
   SupportsDefaultOutlining(false), EmitAddrsig(false),
   EmitCallSiteInfo(false), SupportsDebugEntryValues(false),
-  EnableDebugEntryValues(false), ForceDwarfFrameSection(false),
-  XRayOmitFunctionIndex(false),
+  EnableDebugEntryValues(false), ValueTrackingVariableLocations(false),
+  ForceDwarfFrameSection(false), XRayOmitFunctionIndex(false),
   FPDenormalMode(DenormalMode::IEEE, DenormalMode::IEEE) {}
 
 /// DisableFramePointerElim - This returns true if frame pointer elimination
@@ -285,6 +285,11 @@
 /// production.
 bool ShouldEmitDebugEntryValues() const;
 
+// When set to true, use experimental new debug variable location tracking,
+// which seeks to follow the values of variables rather than their location,
+// post isel.
+unsigned ValueTrackingVariableLocations : 1;
+
 /// Emit DWARF debug frame section.
 unsigned 

[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-08-24 Thread Djordje Todorovic via Phabricator via cfe-commits
djtodoro accepted this revision.
djtodoro added a comment.
This revision is now accepted and ready to land.

nit included, otherwise lgtm, thanks!




Comment at: llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp:45
+  ~LiveDebugValues()
+  {
+if (TheImpl)

is this clang-formatted?




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83048/new/

https://reviews.llvm.org/D83048

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-08-20 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse updated this revision to Diff 286814.
jmorse added a comment.
Herald added a subscriber: dang.

Add a test for the driver -Xclang option. As far as I understand this, we're 
just checking that the switch is accepted by the driver, not that it does 
anything in particular (please correct me if I'm wrong).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83048/new/

https://reviews.llvm.org/D83048

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/CC1Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/debug-var-experimental-switch.c
  llvm/include/llvm/CodeGen/CommandFlags.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp

Index: llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
===
--- llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -12,6 +12,7 @@
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/Target/TargetMachine.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 
@@ -40,7 +41,11 @@
   static char ID;
 
   LiveDebugValues();
-  ~LiveDebugValues() { delete TheImpl; }
+  ~LiveDebugValues()
+  {
+if (TheImpl)
+  delete TheImpl;
+  }
 
   /// Calculate the liveness information for the given machine function.
   bool runOnMachineFunction(MachineFunction ) override;
@@ -57,6 +62,7 @@
 
 private:
   LDVImpl *TheImpl;
+  TargetPassConfig *TPC;
 };
 
 char LiveDebugValues::ID = 0;
@@ -69,10 +75,24 @@
 /// Default construct and initialize the pass.
 LiveDebugValues::LiveDebugValues() : MachineFunctionPass(ID) {
   initializeLiveDebugValuesPass(*PassRegistry::getPassRegistry());
-  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  TheImpl = nullptr;
 }
 
 bool LiveDebugValues::runOnMachineFunction(MachineFunction ) {
-  auto *TPC = getAnalysisIfAvailable();
+  if (!TheImpl) {
+TPC = getAnalysisIfAvailable();
+
+bool InstrRefBased = false;
+if (TPC) {
+  auto  = TPC->getTM();
+  InstrRefBased = TM.Options.ValueTrackingVariableLocations;
+}
+
+if (InstrRefBased)
+  TheImpl = llvm::makeInstrRefBasedLiveDebugValues();
+else
+  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  }
+
   return TheImpl->ExtendRanges(MF, TPC);
 }
Index: llvm/lib/CodeGen/CommandFlags.cpp
===
--- llvm/lib/CodeGen/CommandFlags.cpp
+++ llvm/lib/CodeGen/CommandFlags.cpp
@@ -85,6 +85,7 @@
 CGOPT(bool, EnableAddrsig)
 CGOPT(bool, EmitCallSiteInfo)
 CGOPT(bool, EnableDebugEntryValues)
+CGOPT(bool, ValueTrackingVariableLocations)
 CGOPT(bool, ForceDwarfFrameSection)
 CGOPT(bool, XRayOmitFunctionIndex)
 
@@ -400,6 +401,12 @@
   cl::init(false));
   CGBINDOPT(EnableDebugEntryValues);
 
+  static cl::opt ValueTrackingVariableLocations(
+  "experimental-debug-variable-locations",
+  cl::desc("Use experimental new value-tracking variable locations"),
+  cl::init(false));
+  CGBINDOPT(ValueTrackingVariableLocations);
+
   static cl::opt ForceDwarfFrameSection(
   "force-dwarf-frame-section",
   cl::desc("Always emit a debug frame section."), cl::init(false));
@@ -475,6 +482,7 @@
   Options.EmitAddrsig = getEnableAddrsig();
   Options.EmitCallSiteInfo = getEmitCallSiteInfo();
   Options.EnableDebugEntryValues = getEnableDebugEntryValues();
+  Options.ValueTrackingVariableLocations = getValueTrackingVariableLocations();
   Options.ForceDwarfFrameSection = getForceDwarfFrameSection();
   Options.XRayOmitFunctionIndex = getXRayOmitFunctionIndex();
 
Index: llvm/include/llvm/Target/TargetOptions.h
===
--- llvm/include/llvm/Target/TargetOptions.h
+++ llvm/include/llvm/Target/TargetOptions.h
@@ -127,8 +127,8 @@
   EmitStackSizeSection(false), EnableMachineOutliner(false),
   SupportsDefaultOutlining(false), EmitAddrsig(false),
   EmitCallSiteInfo(false), SupportsDebugEntryValues(false),
-  EnableDebugEntryValues(false), ForceDwarfFrameSection(false),
-  XRayOmitFunctionIndex(false),
+  EnableDebugEntryValues(false), ValueTrackingVariableLocations(false),
+  ForceDwarfFrameSection(false), XRayOmitFunctionIndex(false),
   FPDenormalMode(DenormalMode::IEEE, DenormalMode::IEEE) {}
 
 /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
@@ -291,6 +291,11 @@
 /// production.
 bool ShouldEmitDebugEntryValues() const;
 
+// When set to true, use experimental new debug variable location tracking,
+// which seeks to follow the values of variables rather than their location,
+// post isel.
+unsigned ValueTrackingVariableLocations : 1;
+
   

[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-07-07 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse updated this revision to Diff 276040.
jmorse added a comment.

(Rebase, only affecting LiveDebugValues.cpp)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83048/new/

https://reviews.llvm.org/D83048

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/CC1Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  llvm/include/llvm/CodeGen/CommandFlags.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp

Index: llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
===
--- llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -13,6 +13,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/Target/TargetMachine.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 
@@ -41,7 +42,11 @@
   static char ID;
 
   LiveDebugValues();
-  ~LiveDebugValues() { delete TheImpl; }
+  ~LiveDebugValues()
+  {
+if (TheImpl)
+  delete TheImpl;
+  }
 
   /// Calculate the liveness information for the given machine function.
   bool runOnMachineFunction(MachineFunction ) override;
@@ -58,6 +63,7 @@
 
 private:
   LDVImpl *TheImpl;
+  TargetPassConfig *TPC;
 };
 
 char LiveDebugValues::ID = 0;
@@ -70,10 +76,24 @@
 /// Default construct and initialize the pass.
 LiveDebugValues::LiveDebugValues() : MachineFunctionPass(ID) {
   initializeLiveDebugValuesPass(*PassRegistry::getPassRegistry());
-  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  TheImpl = nullptr;
 }
 
 bool LiveDebugValues::runOnMachineFunction(MachineFunction ) {
-  auto *TPC = getAnalysisIfAvailable();
+  if (!TheImpl) {
+TPC = getAnalysisIfAvailable();
+
+bool InstrRefBased = false;
+if (TPC) {
+  auto  = TPC->getTM();
+  InstrRefBased = TM.Options.ValueTrackingVariableLocations;
+}
+
+if (InstrRefBased)
+  TheImpl = llvm::makeInstrRefBasedLiveDebugValues();
+else
+  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  }
+
   return TheImpl->ExtendRanges(MF, TPC);
 }
Index: llvm/lib/CodeGen/CommandFlags.cpp
===
--- llvm/lib/CodeGen/CommandFlags.cpp
+++ llvm/lib/CodeGen/CommandFlags.cpp
@@ -85,6 +85,7 @@
 CGOPT(bool, EnableAddrsig)
 CGOPT(bool, EmitCallSiteInfo)
 CGOPT(bool, EnableDebugEntryValues)
+CGOPT(bool, ValueTrackingVariableLocations)
 CGOPT(bool, ForceDwarfFrameSection)
 CGOPT(bool, XRayOmitFunctionIndex)
 
@@ -400,6 +401,12 @@
   cl::init(false));
   CGBINDOPT(EnableDebugEntryValues);
 
+  static cl::opt ValueTrackingVariableLocations(
+  "experimental-debug-variable-locations",
+  cl::desc("Use experimental new value-tracking variable locations"),
+  cl::init(false));
+  CGBINDOPT(ValueTrackingVariableLocations);
+
   static cl::opt ForceDwarfFrameSection(
   "force-dwarf-frame-section",
   cl::desc("Always emit a debug frame section."), cl::init(false));
@@ -475,6 +482,7 @@
   Options.EmitAddrsig = getEnableAddrsig();
   Options.EmitCallSiteInfo = getEmitCallSiteInfo();
   Options.EnableDebugEntryValues = getEnableDebugEntryValues();
+  Options.ValueTrackingVariableLocations = getValueTrackingVariableLocations();
   Options.ForceDwarfFrameSection = getForceDwarfFrameSection();
   Options.XRayOmitFunctionIndex = getXRayOmitFunctionIndex();
 
Index: llvm/include/llvm/Target/TargetOptions.h
===
--- llvm/include/llvm/Target/TargetOptions.h
+++ llvm/include/llvm/Target/TargetOptions.h
@@ -127,8 +127,8 @@
   EmitStackSizeSection(false), EnableMachineOutliner(false),
   SupportsDefaultOutlining(false), EmitAddrsig(false),
   EmitCallSiteInfo(false), SupportsDebugEntryValues(false),
-  EnableDebugEntryValues(false), ForceDwarfFrameSection(false),
-  XRayOmitFunctionIndex(false),
+  EnableDebugEntryValues(false), ValueTrackingVariableLocations(false),
+  ForceDwarfFrameSection(false), XRayOmitFunctionIndex(false),
   FPDenormalMode(DenormalMode::IEEE, DenormalMode::IEEE) {}
 
 /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
@@ -291,6 +291,11 @@
 /// production.
 bool ShouldEmitDebugEntryValues() const;
 
+// When set to true, use experimental new debug variable location tracking,
+// which seeks to follow the values of variables rather than their location,
+// post isel.
+unsigned ValueTrackingVariableLocations : 1;
+
 /// Emit DWARF debug frame section.
 unsigned ForceDwarfFrameSection : 1;
 
Index: llvm/include/llvm/CodeGen/CommandFlags.h
===
--- llvm/include/llvm/CodeGen/CommandFlags.h
+++ 

[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-07-02 Thread Djordje Todorovic via Phabricator via cfe-commits
djtodoro added a comment.

Please add a test case for the Driver option (you can take a look into existing 
ones within `clang/test/Driver/`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83048/new/

https://reviews.llvm.org/D83048



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83048: [LiveDebugValues] 3/4 Add Xclang and CodeGen options for using instr-ref variable locations

2020-07-02 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse created this revision.
jmorse added reviewers: aprantl, vsk, probinson, Orlando, StephenTozer, 
TWeaver, djtodoro.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
jmorse added a parent revision: D83047: [LiveDebugValues] 2/4 Add 
instruction-referencing LiveDebugValues implementation.

(Context: this thread 
http://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html )

This patch adds the -Xclang option "-fexperimental-debug-variable-locations" 
and same LLVM CodeGen option, to pick which variable location tracking solution 
to use.

Right now all the switch does is pick which LiveDebugValues implementation to 
use. Over time however, my aim is to add fragments of support in aid of this 
value-tracking RFC 
, also 
controlled by this command line switch. That will slowly move variable 
locations to be defined by an instruction calculating a value, and a 
DBG_INSTR_REF instruction referring to that value. Thus, this is going to grow 
into a "use the new kind of variable locations" switch, rather than just "use 
the new LiveDebugValues implementation".


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83048

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/CC1Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  llvm/include/llvm/CodeGen/CommandFlags.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp

Index: llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
===
--- llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -3,6 +3,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/Target/TargetMachine.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 
@@ -49,6 +50,7 @@
   }
 
   LDVImpl *TheImpl;
+  TargetPassConfig *TPC;
 };
 
 char LiveDebugValues::ID = 0;
@@ -61,15 +63,31 @@
 /// Default construct and initialize the pass.
 LiveDebugValues::LiveDebugValues() : MachineFunctionPass(ID) {
   initializeLiveDebugValuesPass(*PassRegistry::getPassRegistry());
-  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  TheImpl = nullptr;
 }
 
 LiveDebugValues::~LiveDebugValues() {
-  delete TheImpl;
+  if (TheImpl)
+delete TheImpl;
 }
 
 bool LiveDebugValues::runOnMachineFunction(MachineFunction ) {
-  auto *TPC = getAnalysisIfAvailable();
+  if (!TheImpl) {
+TPC = getAnalysisIfAvailable();
+
+bool InstrRefBased = false;
+if (TPC) {
+  auto  = TPC->getTM();
+  InstrRefBased = TM.Options.ValueTrackingVariableLocations;
+}
+
+if (InstrRefBased)
+  TheImpl = llvm::makeInstrRefBasedLiveDebugValues();
+else
+  TheImpl = llvm::makeVarLocBasedLiveDebugValues();
+  }
+
+
   return TheImpl->ExtendRanges(MF, TPC);
 }
 
Index: llvm/lib/CodeGen/CommandFlags.cpp
===
--- llvm/lib/CodeGen/CommandFlags.cpp
+++ llvm/lib/CodeGen/CommandFlags.cpp
@@ -85,6 +85,7 @@
 CGOPT(bool, EnableAddrsig)
 CGOPT(bool, EmitCallSiteInfo)
 CGOPT(bool, EnableDebugEntryValues)
+CGOPT(bool, ValueTrackingVariableLocations)
 CGOPT(bool, ForceDwarfFrameSection)
 CGOPT(bool, XRayOmitFunctionIndex)
 
@@ -400,6 +401,12 @@
   cl::init(false));
   CGBINDOPT(EnableDebugEntryValues);
 
+  static cl::opt ValueTrackingVariableLocations(
+  "experimental-debug-variable-locations",
+  cl::desc("Use experimental new value-tracking variable locations"),
+  cl::init(false));
+  CGBINDOPT(ValueTrackingVariableLocations);
+
   static cl::opt ForceDwarfFrameSection(
   "force-dwarf-frame-section",
   cl::desc("Always emit a debug frame section."), cl::init(false));
@@ -475,6 +482,7 @@
   Options.EmitAddrsig = getEnableAddrsig();
   Options.EmitCallSiteInfo = getEmitCallSiteInfo();
   Options.EnableDebugEntryValues = getEnableDebugEntryValues();
+  Options.ValueTrackingVariableLocations = getValueTrackingVariableLocations();
   Options.ForceDwarfFrameSection = getForceDwarfFrameSection();
   Options.XRayOmitFunctionIndex = getXRayOmitFunctionIndex();
 
Index: llvm/include/llvm/Target/TargetOptions.h
===
--- llvm/include/llvm/Target/TargetOptions.h
+++ llvm/include/llvm/Target/TargetOptions.h
@@ -127,8 +127,8 @@
   EmitStackSizeSection(false), EnableMachineOutliner(false),
   SupportsDefaultOutlining(false), EmitAddrsig(false),
   EmitCallSiteInfo(false), SupportsDebugEntryValues(false),
-  EnableDebugEntryValues(false), ForceDwarfFrameSection(false),
-  XRayOmitFunctionIndex(false),
+