Skip to content

Commit

Permalink
[LLD/MinGW]: Expose --thinlto-cache-dir
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D80438
  • Loading branch information
tru authored and mstorsjo committed May 24, 2020
1 parent 8310c9b commit f794808
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lld/MinGW/Driver.cpp
Expand Up @@ -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()));
Expand Down
2 changes: 2 additions & 0 deletions lld/MinGW/Options.td
Expand Up @@ -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">;

Expand Down
3 changes: 3 additions & 0 deletions lld/test/MinGW/driver.test
Expand Up @@ -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

0 comments on commit f794808

Please sign in to comment.