[lld] r299106 - Add parsing of mllvm command line options.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 13:10:40 PDT 2017
Author: ruiu
Date: Thu Mar 30 15:10:40 2017
New Revision: 299106
URL: http://llvm.org/viewvc/llvm-project?rev=299106&view=rev
Log:
Add parsing of mllvm command line options.
Patch by Alberto Magni
Original patch by Kyungwoo Lee <kyulee at microsoft.com>
Differential Revision: https://reviews.llvm.org/D31388
Added:
lld/trunk/test/COFF/lto-debug-pass-arguments.ll
Modified:
lld/trunk/COFF/Driver.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=299106&r1=299105&r2=299106&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Thu Mar 30 15:10:40 2017
@@ -574,6 +574,13 @@ void LinkerDriver::link(ArrayRef<const c
// Parse command line options.
opt::InputArgList Args = Parser.parseLINK(ArgsArr.slice(1));
+ // Parse and evaluate -mllvm options.
+ std::vector<const char *> V;
+ V.push_back("lld-link (LLVM option parsing)");
+ for (auto *Arg : Args.filtered(OPT_mllvm))
+ V.push_back(Arg->getValue());
+ cl::ParseCommandLineOptions(V.size(), V.data());
+
// Handle /help
if (Args.hasArg(OPT_help)) {
printHelp(ArgsArr[0]);
Added: lld/trunk/test/COFF/lto-debug-pass-arguments.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/lto-debug-pass-arguments.ll?rev=299106&view=auto
==============================================================================
--- lld/trunk/test/COFF/lto-debug-pass-arguments.ll (added)
+++ lld/trunk/test/COFF/lto-debug-pass-arguments.ll Thu Mar 30 15:10:40 2017
@@ -0,0 +1,16 @@
+; REQUIRES: x86
+; RUN: llvm-as %s -o %t.obj
+; RUN: lld-link /dll /out:%t.dll %t.obj /mllvm:-debug-pass=Arguments 2>&1 | FileCheck %s
+
+target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc"
+
+define void @dummy() {
+ ret void
+}
+
+define void @_DllMainCRTStartup() {
+ ret void
+}
+
+; CHECK: Pass Arguments:
More information about the llvm-commits
mailing list