[PATCH] D16094: Debugger tuning via gold plugin

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 11:50:45 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL258712: LTO via the gold plugin needs to be told about debugger tuning. (authored by probinson).

Changed prior to commit:
  http://reviews.llvm.org/D16094?vs=44575&id=45893#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16094

Files:
  cfe/trunk/lib/Driver/Tools.cpp
  cfe/trunk/test/Driver/lto.c

Index: cfe/trunk/test/Driver/lto.c
===================================================================
--- cfe/trunk/test/Driver/lto.c
+++ cfe/trunk/test/Driver/lto.c
@@ -49,3 +49,12 @@
 // RUN: FileCheck -check-prefix=CHECK-LINK-NOLTO-ACTION < %t %s
 //
 // CHECK-LINK-NOLTO-ACTION-NOT: "-plugin" "{{.*}}/LLVMgold.so"
+
+// -flto passes along an explicit debugger tuning argument.
+// RUN: %clang -target x86_64-unknown-linux -### %s -flto -glldb 2> %t
+// RUN: FileCheck -check-prefix=CHECK-TUNING-LLDB < %t %s
+// RUN: %clang -target x86_64-unknown-linux -### %s -flto -g 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NO-TUNING < %t %s
+//
+// CHECK-TUNING-LLDB:   "-plugin-opt=-debugger-tune=lldb"
+// CHECK-NO-TUNING-NOT: "-plugin-opt=-debugger-tune
Index: cfe/trunk/lib/Driver/Tools.cpp
===================================================================
--- cfe/trunk/lib/Driver/Tools.cpp
+++ cfe/trunk/lib/Driver/Tools.cpp
@@ -1817,6 +1817,17 @@
 
   if (IsThinLTO)
     CmdArgs.push_back("-plugin-opt=thinlto");
+
+  // If an explicit debugger tuning argument appeared, pass it along.
+  if (Arg *A = Args.getLastArg(options::OPT_gTune_Group,
+                               options::OPT_ggdbN_Group)) {
+    if (A->getOption().matches(options::OPT_glldb))
+      CmdArgs.push_back("-plugin-opt=-debugger-tune=lldb");
+    else if (A->getOption().matches(options::OPT_gsce))
+      CmdArgs.push_back("-plugin-opt=-debugger-tune=sce");
+    else
+      CmdArgs.push_back("-plugin-opt=-debugger-tune=gdb");
+  }
 }
 
 /// This is a helper function for validating the optional refinement step


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16094.45893.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160125/1872795f/attachment-0001.bin>


More information about the cfe-commits mailing list