diff options
| author | Manman Ren <mren@apple.com> | 2013-06-19 01:46:49 +0000 |
|---|---|---|
| committer | Manman Ren <mren@apple.com> | 2013-06-19 01:46:49 +0000 |
| commit | fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01 (patch) | |
| tree | ae6530424344a2417b58a0343a0a1c638ec2d14e /lib/Frontend/CompilerInvocation.cpp | |
| parent | 0fa93cecf26a157dec7def11ffa4080ae75fe559 (diff) | |
| download | clang-fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01.tar.gz clang-fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01.tar.bz2 clang-fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01.tar.xz | |
Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
| -rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 1407e105f2..d9316ec4f0 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -318,7 +318,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, if (Args.hasArg(OPT_gline_tables_only)) { Opts.setDebugInfo(CodeGenOptions::DebugLineTablesOnly); - } else if (Args.hasArg(OPT_g_Flag)) { + } else if (Args.hasArg(OPT_g_Flag) || Args.hasArg(OPT_gdwarf_2) || + Args.hasArg(OPT_gdwarf_3) || Args.hasArg(OPT_gdwarf_4)) { if (Args.hasFlag(OPT_flimit_debug_info, OPT_fno_limit_debug_info, true)) Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo); else @@ -326,6 +327,15 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, } Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info); Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file); + if (Args.hasArg(OPT_gdwarf_2)) + Opts.DwarfVersion = 2; + else if (Args.hasArg(OPT_gdwarf_3)) + Opts.DwarfVersion = 3; + else if (Args.hasArg(OPT_gdwarf_4)) + Opts.DwarfVersion = 4; + else if (Opts.getDebugInfo() != CodeGenOptions::NoDebugInfo) + // Default Dwarf version is 3 if we are generating debug information. + Opts.DwarfVersion = 3; Opts.DisableLLVMOpts = Args.hasArg(OPT_disable_llvm_optzns); Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone); |
