]> granicus.if.org Git - clang/commitdiff
CC1 part of debugger tuning; pass through setting from driver to LLVM.
authorPaul Robinson <paul_robinson@playstation.sony.com>
Fri, 18 Dec 2015 23:41:11 +0000 (23:41 +0000)
committerPaul Robinson <paul_robinson@playstation.sony.com>
Fri, 18 Dec 2015 23:41:11 +0000 (23:41 +0000)
Differential Revision: http://reviews.llvm.org/D15650

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256063 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Frontend/CodeGenOptions.def
include/clang/Frontend/CodeGenOptions.h
lib/CodeGen/BackendUtil.cpp
lib/Frontend/CompilerInvocation.cpp

index d510e19ea916d3a3309eafd54a0463c522dff7a3..d7f42a991a8f394ae8392c6f49acf03ced970646 100644 (file)
@@ -134,6 +134,7 @@ let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
 
 def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
 def dwarf_version_EQ : Joined<["-"], "dwarf-version=">;
+def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">;
 def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
   HelpText<"The compilation directory to embed in the debug info.">;
 def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
index 795d7e9bce8b9e279edf3b19a6650ba3dd3cba31..29efdda6f68da78f9084c3569c210ab9d31daa63 100644 (file)
@@ -183,6 +183,10 @@ VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
 /// The kind of generated debug info.
 ENUM_CODEGENOPT(DebugInfo, DebugInfoKind, 3, NoDebugInfo)
 
+/// Tune the debug info for this debugger.
+ENUM_CODEGENOPT(DebuggerTuning, llvm::DebuggerKind, 2,
+                llvm::DebuggerKind::Default)
+
 /// Dwarf version. Version zero indicates to LLVM that no DWARF should be
 /// emitted.
 VALUE_CODEGENOPT(DwarfVersion, 3, 0)
index 5bf8f8b92b480b52f361e7612d5fe5a8bfc9db37..7021bcf54f9b7c2f2d7b1cbdd35410aa1fe1c151 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "clang/Basic/Sanitizers.h"
 #include "llvm/Support/Regex.h"
+#include "llvm/Target/TargetOptions.h"
 #include <map>
 #include <memory>
 #include <string>
index 784e9c7ba5f7dc7d2e6513200f75f0d8516bb5f6..c4a98156d78829e1d854554b8712ca064a920390 100644 (file)
@@ -553,6 +553,7 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
   Options.DataSections = CodeGenOpts.DataSections;
   Options.UniqueSectionNames = CodeGenOpts.UniqueSectionNames;
   Options.EmulatedTLS = CodeGenOpts.EmulatedTLS;
+  Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning();
 
   Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
   Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;
index c6068d7d94dd46a1852776f495fed2491862d8df..a03dded70768a71f67d9f1e8519cb5fb7a7696ac 100644 (file)
@@ -405,6 +405,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
             .Case("limited", CodeGenOptions::LimitedDebugInfo)
             .Case("standalone", CodeGenOptions::FullDebugInfo));
   }
+  if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) {
+    Opts.setDebuggerTuning(
+        llvm::StringSwitch<llvm::DebuggerKind>(A->getValue())
+            .Case("gdb", llvm::DebuggerKind::GDB)
+            .Case("lldb", llvm::DebuggerKind::LLDB)
+            .Case("sce", llvm::DebuggerKind::SCE));
+  }
   Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags);
   Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
   Opts.EmitCodeView = Args.hasArg(OPT_gcodeview);