[lld] f794808 - [LLD/MinGW]: Expose --thinlto-cache-dir

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Sun May 24 02:34:45 PDT 2020


Author: Tobias Hieta
Date: 2020-05-24T12:30:56+03:00
New Revision: f794808bb9ec06966a67fe33d41a13b9601768f8

URL: https://github.com/llvm/llvm-project/commit/f794808bb9ec06966a67fe33d41a13b9601768f8
DIFF: https://github.com/llvm/llvm-project/commit/f794808bb9ec06966a67fe33d41a13b9601768f8.diff

LOG: [LLD/MinGW]: Expose --thinlto-cache-dir

Differential Revision: https://reviews.llvm.org/D80438

Added: 
    

Modified: 
    lld/MinGW/Driver.cpp
    lld/MinGW/Options.td
    lld/test/MinGW/driver.test

Removed: 
    


################################################################################
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<const char *> 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<"<arg>">,
     HelpText<"Pass <arg> 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


        


More information about the llvm-commits mailing list