From 639d36b34e6eae75ee211bba83b7e45151e1272d Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Wed, 26 Jun 2019 09:38:09 +0000 Subject: [CC1Option] Add the option to enable the debug entry values The option enables debug info about parameter's entry values. The example of using the option: clang -g -O2 -Xclang -femit-debug-entry-values test.c In addition, when the option is set add the flag all_call_sites in a subprogram in order to support GNU extension as well. ([3/13] Introduce the debug entry values.) Co-authored-by: Ananth Sowda Co-authored-by: Nikola Prica Co-authored-by: Ivan Baev Differential Revision: https://reviews.llvm.org/D58033 llvm-svn: 364399 --- clang/lib/Frontend/CompilerInvocation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b90950f..cdb6d73 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -760,6 +760,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.DisableLLVMPasses = Args.hasArg(OPT_disable_llvm_passes); Opts.DisableLifetimeMarkers = Args.hasArg(OPT_disable_lifetimemarkers); + + llvm::Triple T(TargetOpts.Triple); + llvm::Triple::ArchType Arch = T.getArch(); + if (Opts.OptimizationLevel > 0 && + (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)) + Opts.EnableDebugEntryValues = Args.hasArg(OPT_femit_debug_entry_values); + Opts.DisableO0ImplyOptNone = Args.hasArg(OPT_disable_O0_optnone); Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone); Opts.IndirectTlsSegRefs = Args.hasArg(OPT_mno_tls_direct_seg_refs); -- cgit v1.1