summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-06-26 09:38:09 +0000
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>2019-06-26 09:38:09 +0000
commit639d36b34e6eae75ee211bba83b7e45151e1272d (patch)
tree385f5b8586ada81176b00616e84b91bc58084930 /clang/lib/Frontend
parent4c11b5268ca295b156159bed9d520fcb85fcf068 (diff)
downloadbcm5719-llvm-639d36b34e6eae75ee211bba83b7e45151e1272d.tar.gz
bcm5719-llvm-639d36b34e6eae75ee211bba83b7e45151e1272d.zip
[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 <asowda@cisco.com> Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com> Co-authored-by: Ivan Baev <ibaev@cisco.com> Differential Revision: https://reviews.llvm.org/D58033 llvm-svn: 364399
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b90950fb3ef..cdb6d735364 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);
OpenPOWER on IntegriCloud