[PATCH] D67004: [DebugInfo] Enable call site parameter debug info for ARM and AArch64

Nikola Prica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 07:15:11 PDT 2019


NikolaPrica created this revision.
NikolaPrica added reviewers: aprantl, probinson, dstenb, vsk.
NikolaPrica added a project: debug-info.
Herald added subscribers: kristof.beyls, javed.absar.
NikolaPrica added a parent revision: D66955: [DebugInfo][If-Converter] Update call site info during the optimization.

ARM and AArch64 SelectionDAG support for tacking parameter forwarding register is implemented so we can allow clang invocations for those two targets.
Beside that restrict debug entry value support  to be emitted for LimitedDebugInfo info and FullDebugInfo. Other types of debug info do not have functions nor variables debug info.


https://reviews.llvm.org/D67004

Files:
  lib/CodeGen/CGDebugInfo.cpp
  lib/Frontend/CompilerInvocation.cpp


Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -777,10 +777,16 @@
   Opts.DisableLLVMPasses = Args.hasArg(OPT_disable_llvm_passes);
   Opts.DisableLifetimeMarkers = Args.hasArg(OPT_disable_lifetimemarkers);
 
+  auto isDebugEntryValueSupportedByArch = [](llvm::Triple::ArchType Arch) {
+    return Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64 ||
+           Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::arm ||
+           Arch == llvm::Triple::armeb;
+  };
+
   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.getDebugInfo() >= codegenoptions::LimitedDebugInfo &&
+      isDebugEntryValueSupportedByArch(T.getArch()))
     Opts.EnableDebugEntryValues = Args.hasArg(OPT_femit_debug_entry_values);
 
   Opts.DisableO0ImplyOptNone = Args.hasArg(OPT_disable_O0_optnone);
Index: lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- lib/CodeGen/CGDebugInfo.cpp
+++ lib/CodeGen/CGDebugInfo.cpp
@@ -3698,8 +3698,7 @@
                                           const FunctionDecl *CalleeDecl) {
   auto &CGOpts = CGM.getCodeGenOpts();
   if (!CGOpts.EnableDebugEntryValues || !CGM.getLangOpts().Optimize ||
-      !CallOrInvoke ||
-      CGM.getCodeGenOpts().getDebugInfo() < codegenoptions::LimitedDebugInfo)
+      !CallOrInvoke)
     return;
 
   auto *Func = CallOrInvoke->getCalledFunction();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67004.218086.patch
Type: text/x-patch
Size: 1656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190830/5a4e56e9/attachment.bin>


More information about the llvm-commits mailing list