Skip to content

Commit a3ff2e4

Browse files
author
Paul Robinson
committedDec 18, 2015
CC1 part of debugger tuning; pass through setting from driver to LLVM.
Differential Revision: http://reviews.llvm.org/D15650 llvm-svn: 256063
1 parent bfc2dc7 commit a3ff2e4

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed
 

‎clang/include/clang/Driver/CC1Options.td

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
134134

135135
def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
136136
def dwarf_version_EQ : Joined<["-"], "dwarf-version=">;
137+
def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">;
137138
def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
138139
HelpText<"The compilation directory to embed in the debug info.">;
139140
def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,

‎clang/include/clang/Frontend/CodeGenOptions.def

+4
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
183183
/// The kind of generated debug info.
184184
ENUM_CODEGENOPT(DebugInfo, DebugInfoKind, 3, NoDebugInfo)
185185

186+
/// Tune the debug info for this debugger.
187+
ENUM_CODEGENOPT(DebuggerTuning, llvm::DebuggerKind, 2,
188+
llvm::DebuggerKind::Default)
189+
186190
/// Dwarf version. Version zero indicates to LLVM that no DWARF should be
187191
/// emitted.
188192
VALUE_CODEGENOPT(DwarfVersion, 3, 0)

‎clang/include/clang/Frontend/CodeGenOptions.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "clang/Basic/Sanitizers.h"
1818
#include "llvm/Support/Regex.h"
19+
#include "llvm/Target/TargetOptions.h"
1920
#include <map>
2021
#include <memory>
2122
#include <string>

‎clang/lib/CodeGen/BackendUtil.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
553553
Options.DataSections = CodeGenOpts.DataSections;
554554
Options.UniqueSectionNames = CodeGenOpts.UniqueSectionNames;
555555
Options.EmulatedTLS = CodeGenOpts.EmulatedTLS;
556+
Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning();
556557

557558
Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
558559
Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;

‎clang/lib/Frontend/CompilerInvocation.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
405405
.Case("limited", CodeGenOptions::LimitedDebugInfo)
406406
.Case("standalone", CodeGenOptions::FullDebugInfo));
407407
}
408+
if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) {
409+
Opts.setDebuggerTuning(
410+
llvm::StringSwitch<llvm::DebuggerKind>(A->getValue())
411+
.Case("gdb", llvm::DebuggerKind::GDB)
412+
.Case("lldb", llvm::DebuggerKind::LLDB)
413+
.Case("sce", llvm::DebuggerKind::SCE));
414+
}
408415
Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags);
409416
Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
410417
Opts.EmitCodeView = Args.hasArg(OPT_gcodeview);

0 commit comments

Comments
 (0)