From 124955aade67bb0455a8c0dc1f01d86b265ef277 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 5 Aug 2015 18:51:13 +0000 Subject: 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 --- clang/lib/Frontend/CompilerInvocation.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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)) -- cgit v1.2.3