[PATCH] D20423: [Clang][LLVMGold] Passing LLVM arguments to gold plugin

Bhargav Reddy Godala via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 23:06:25 PDT 2016


bunty2020 updated this revision to Diff 57899.
bunty2020 added a comment.
Herald added a subscriber: joker.eph.

Added test in test/Driver/gold-lto.c


http://reviews.llvm.org/D20423

Files:
  lib/Driver/Tools.cpp
  test/Driver/gold-lto.c

Index: test/Driver/gold-lto.c
===================================================================
--- test/Driver/gold-lto.c
+++ test/Driver/gold-lto.c
@@ -7,6 +7,12 @@
 // CHECK-X86-64-BASIC: "-plugin-opt=O3"
 // CHECK-X86-64-BASIC: "-plugin-opt=foo"
 //
+// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
+// RUN:     -mllvm -debug \
+// RUN:     | FileCheck %s --check-prefix=CHECK-X86-64-MLLVM
+// CHECK-X86-64-MLLVM: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-64-MLLVM: "-plugin-opt=-debug"
+//
 // RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
 // RUN:     -march=corei7 -Wl,-plugin-opt=foo -Ofast \
 // RUN:     | FileCheck %s --check-prefix=CHECK-X86-64-COREI7
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -1923,6 +1923,10 @@
     else
       CmdArgs.push_back("-plugin-opt=-debugger-tune=gdb");
   }
+  for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
+    CmdArgs.push_back(Args.MakeArgString("-plugin-opt="
+                                         + StringRef(A->getValue(0))));
+  }
 }
 
 /// This is a helper function for validating the optional refinement step


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20423.57899.patch
Type: text/x-patch
Size: 1225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160520/3b3c5ad6/attachment.bin>


More information about the llvm-commits mailing list