Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.

llvm-svn: 143733
This commit is contained in:
Devang Patel 2011-11-04 20:05:58 +00:00
parent c2bf338d35
commit 384dfa4f10
5 changed files with 8 additions and 2 deletions

View File

@ -131,6 +131,8 @@ def no_implicit_float : Flag<"-no-implicit-float">,
HelpText<"Don't generate implicit floating point instructions (x86-only)">;
def finstrument_functions : Flag<"-finstrument-functions">,
HelpText<"Generate calls to instrument function entry and exit">;
def fno_limit_debug_info : Flag<"-fno-limit-debug-info">,
HelpText<"Do not limit debug information produced to reduce size of debug binary">;
def fno_merge_all_constants : Flag<"-fno-merge-all-constants">,
HelpText<"Disallow merging of constants.">;
def fno_threadsafe_statics : Flag<"-fno-threadsafe-statics">,

View File

@ -384,6 +384,8 @@ def fno_inline_functions : Flag<"-fno-inline-functions">, Group<clang_ignored_f_
def fno_inline : Flag<"-fno-inline">, Group<clang_ignored_f_Group>;
def fno_keep_inline_functions : Flag<"-fno-keep-inline-functions">, Group<clang_ignored_f_Group>;
def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, Group<f_Group>;
def fno_limit_debug_info : Flag<"-fno-limit-debug-info">, Group<f_Group>,
HelpText<"Do not limit debug information produced to reduce size of debug binary">;
def fno_math_errno : Flag<"-fno-math-errno">, Group<f_Group>;
def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, Group<f_Group>;
def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group<f_Group>;

View File

@ -1711,6 +1711,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
Args.AddLastArg(CmdArgs, options::OPT_flimit_debug_info);
Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info);
Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
if (getToolChain().SupportsProfiling())
Args.AddLastArg(CmdArgs, options::OPT_pg);

View File

@ -1019,7 +1019,8 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
: CodeGenOptions::OnlyAlwaysInlining;
Opts.DebugInfo = Args.hasArg(OPT_g);
Opts.LimitDebugInfo = Args.hasArg(OPT_flimit_debug_info);
Opts.LimitDebugInfo = !Args.hasArg(OPT_fno_limit_debug_info)
|| Args.hasArg(OPT_flimit_debug_info);
Opts.DisableLLVMOpts = Args.hasArg(OPT_disable_llvm_optzns);
Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone);
Opts.ForbidGuardVariables = Args.hasArg(OPT_fforbid_guard_variables);

View File

@ -1,5 +1,5 @@
// REQUIRES: x86-64-registered-target
// RUN: %clang -cc1 -triple x86_64-apple-darwin10 -g -S %s -o %t
// RUN: %clang -cc1 -triple x86_64-apple-darwin10 -g -fno-limit-debug-info -S %s -o %t
// RUN: FileCheck %s < %t
//CHECK: .asciz "G"