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<"">, HelpText<"Root name of library to use">; def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; +def mllvm: S<"mllvm">; def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"">, 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: