[PATCH] D37712: Add support for mllvm to the MinGW driver

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 14:38:09 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL312956: LLD: Add -mllvm flag to the MinGW driver. (authored by martell).

Changed prior to commit:
  https://reviews.llvm.org/D37712?vs=114690&id=114702#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37712

Files:
  lld/trunk/MinGW/Driver.cpp
  lld/trunk/MinGW/Options.td
  lld/trunk/test/MinGW/lto-debug-pass-arguments.ll


Index: lld/trunk/MinGW/Driver.cpp
===================================================================
--- lld/trunk/MinGW/Driver.cpp
+++ lld/trunk/MinGW/Driver.cpp
@@ -160,6 +160,9 @@
       error("unknown parameter: -m" + S);
   }
 
+  for (auto *A : Args.filtered(OPT_mllvm))
+    Add("-mllvm:" + StringRef(A->getValue()));
+
   if (Args.getLastArgValue(OPT_m) == "i386pe")
     Add("-alternatename:__image_base__=___ImageBase");
   else
Index: lld/trunk/MinGW/Options.td
===================================================================
--- lld/trunk/MinGW/Options.td
+++ lld/trunk/MinGW/Options.td
@@ -11,6 +11,7 @@
 def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
   HelpText<"Root name of library to use">;
 def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
+def mllvm: S<"mllvm">;
 def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
   HelpText<"Path to file to write output">;
 def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">;
Index: lld/trunk/test/MinGW/lto-debug-pass-arguments.ll
===================================================================
--- lld/trunk/test/MinGW/lto-debug-pass-arguments.ll
+++ lld/trunk/test/MinGW/lto-debug-pass-arguments.ll
@@ -0,0 +1,16 @@
+; REQUIRES: x86
+; RUN: llvm-as %s -o %t.obj
+; RUN: ld.lld -m i386pep -shared -o %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-gnu"
+
+define void @dummy() {
+  ret void
+}
+
+define void @_DllMainCRTStartup() {
+  ret void
+}
+
+; CHECK: Pass Arguments:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37712.114702.patch
Type: text/x-patch
Size: 1634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170911/e538d300/attachment.bin>


More information about the llvm-commits mailing list