[PATCH] D80438: [LLD/MinGW]: Expose --thinlto-cache-dir

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 06:56:49 PDT 2020


thieta created this revision.
thieta added a reviewer: mstorsjo.
thieta added a project: lld.
Herald added subscribers: llvm-commits, dexonsmith, inglorion.
Herald added a project: LLVM.

This came up in this comment here: https://reviews.llvm.org/D80425#inline-737983

and this seems like the more proper fix for sure.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80438

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


Index: lld/test/MinGW/driver.test
===================================================================
--- lld/test/MinGW/driver.test
+++ lld/test/MinGW/driver.test
@@ -241,3 +241,6 @@
 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
\ No newline at end of file
Index: lld/MinGW/Options.td
===================================================================
--- lld/MinGW/Options.td
+++ lld/MinGW/Options.td
@@ -81,6 +81,10 @@
 defm require_defined: Eq<"require-defined",
      "Force symbol to be added to symbol table as an undefined one">;
 
+// ThinLTO options
+defm thinlto_cache_dir: Eq<"thinlto-cache-dir",
+  "Path to ThinLTO cached object file directory">;
+
 // LLD specific options
 def _HASH_HASH_HASH : Flag<["-"], "###">,
     HelpText<"Print (but do not run) the commands to run for this compilation">;
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -348,6 +348,8 @@
     add("-includeoptional:" + StringRef(a->getValue()));
   for (auto *a : args.filtered(OPT_delayload))
     add("-delayload:" + StringRef(a->getValue()));
+  for (auto *a : args.filtered(OPT_thinlto_cache_dir))
+    add("-lldltocache:" + StringRef(a->getValue()));
 
   std::vector<StringRef> searchPaths;
   for (auto *a : args.filtered(OPT_L)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80438.265733.patch
Type: text/x-patch
Size: 1732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200522/8f164834/attachment.bin>


More information about the llvm-commits mailing list