diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index bfcdc935e800..e7540a180ae5 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -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">, diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 40a814ee75b5..61e59677176c 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -384,6 +384,8 @@ def fno_inline_functions : Flag<"-fno-inline-functions">, Group, Group; def fno_keep_inline_functions : Flag<"-fno-keep-inline-functions">, Group; def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, Group; +def fno_limit_debug_info : Flag<"-fno-limit-debug-info">, Group, + HelpText<"Do not limit debug information produced to reduce size of debug binary">; def fno_math_errno : Flag<"-fno-math-errno">, Group; def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, Group; def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group; diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 8c0382fbf3a2..bfd73827b4ef 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -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); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b4982903997c..399e0ca8d86c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -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); diff --git a/clang/test/CodeGenCXX/debug-info-pubtypes.cpp b/clang/test/CodeGenCXX/debug-info-pubtypes.cpp index 35ba90b13f87..e94f41992c45 100644 --- a/clang/test/CodeGenCXX/debug-info-pubtypes.cpp +++ b/clang/test/CodeGenCXX/debug-info-pubtypes.cpp @@ -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"