From f794808bb9ec06966a67fe33d41a13b9601768f8 Mon Sep 17 00:00:00 2001 From: Tobias Hieta Date: Sun, 24 May 2020 12:29:16 +0300 Subject: [PATCH] [LLD/MinGW]: Expose --thinlto-cache-dir Differential Revision: https://reviews.llvm.org/D80438 --- lld/MinGW/Driver.cpp | 2 ++ lld/MinGW/Options.td | 2 ++ lld/test/MinGW/driver.test | 3 +++ 3 files changed, 7 insertions(+) diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index fbf50280cc8c..e7f51a36a39d 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -249,6 +249,8 @@ bool mingw::link(ArrayRef argsArr, bool canExitEarly, add("-lldmap:" + StringRef(a->getValue())); if (auto *a = args.getLastArg(OPT_reproduce)) add("-reproduce:" + StringRef(a->getValue())); + if (auto *a = args.getLastArg(OPT_thinlto_cache_dir)) + add("-lldltocache:" + StringRef(a->getValue())); if (auto *a = args.getLastArg(OPT_o)) add("-out:" + StringRef(a->getValue())); diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td index a3a84883feb2..6410e4c1901c 100644 --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -88,6 +88,8 @@ def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the defm delayload: Eq<"delayload", "DLL to load only on demand">; def mllvm: S<"mllvm">; defm pdb: Eq<"pdb", "Output PDB debug info file, chosen implicitly if the argument is empty">; +defm thinlto_cache_dir: EqLong<"thinlto-cache-dir", + "Path to ThinLTO cached object file directory">; def Xlink : J<"Xlink=">, MetaVarName<"">, HelpText<"Pass to the COFF linker">; diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test index 16b4179a92bc..803bf34f1ec5 100644 --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -241,3 +241,6 @@ ENABLE_RUNTIME_PSEUDO_RELOC: -runtime-pseudo-reloc{{ }} RUN: ld.lld -### -m i386pep foo.o --disable-runtime-pseudo-reloc | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s RUN: ld.lld -### -m i386pep foo.o -disable-runtime-pseudo-reloc | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s DISABLE_RUNTIME_PSEUDO_RELOC: -runtime-pseudo-reloc:no + +RUN: ld.lld -### foo.o -m i386pe --thinlto-cache-dir=_foo | FileCheck -check-prefix=THINLTO_CACHEDIR %s +THINLTO_CACHEDIR: -lldltocache:_foo