diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-08-05 18:51:13 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-08-05 18:51:13 +0000 |
commit | 124955aade67bb0455a8c0dc1f01d86b265ef277 (patch) | |
tree | 3a2e5625ea970deabec9e390df20e2566732bbe8 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | b2fda0d95ca1d27b1f6b1707685bd0f3fd8789d9 (diff) | |
download | bcm5719-llvm-124955aade67bb0455a8c0dc1f01d86b265ef277.tar.gz bcm5719-llvm-124955aade67bb0455a8c0dc1f01d86b265ef277.zip |
Add -gcodeview and -gdwarf to control which type Clang emits
Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview. You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.
Reviewers: dblaikie, hans
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11742
llvm-svn: 244097
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 06e8554d9d3..0f09db2bff3 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -410,6 +410,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo); } Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info); + if (Args.hasArg(OPT_gcodeview)) { + Opts.EmitCodeView = true; + Opts.DwarfVersion = 0; + } else if (Opts.getDebugInfo() != CodeGenOptions::NoDebugInfo) { + // Default Dwarf version is 4 if we are generating debug information. + Opts.DwarfVersion = 4; + } Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file); if (Args.hasArg(OPT_gdwarf_2)) Opts.DwarfVersion = 2; @@ -417,9 +424,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.DwarfVersion = 3; else if (Args.hasArg(OPT_gdwarf_4)) Opts.DwarfVersion = 4; - else if (Opts.getDebugInfo() != CodeGenOptions::NoDebugInfo) - // Default Dwarf version is 4 if we are generating debug information. - Opts.DwarfVersion = 4; if (const Arg *A = Args.getLastArg(OPT_emit_llvm_uselists, OPT_no_emit_llvm_uselists)) |