Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lld/COFF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2104,18 +2104,18 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
config->dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor);

// Handle /thinlto-distributor-arg:<arg>
for (auto *arg : args.filtered(OPT_thinlto_distributor_arg))
config->dtltoDistributorArgs.push_back(arg->getValue());
config->dtltoDistributorArgs =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

args::getStrings(args, OPT_thinlto_distributor_arg);

// Handle /thinlto-remote-compiler:<path>
config->dtltoCompiler = args.getLastArgValue(OPT_thinlto_compiler);
config->dtltoCompiler = args.getLastArgValue(OPT_thinlto_remote_compiler);
if (!config->dtltoDistributor.empty() && config->dtltoCompiler.empty())
Err(ctx) << "A value must be specified for /thinlto-remote-compiler if "
"/thinlto-distributor is specified.";

// Handle /thinlto-remote-compiler-arg:<arg>
for (auto *arg : args.filtered(OPT_thinlto_compiler_arg))
config->dtltoCompilerArgs.push_back(arg->getValue());
config->dtltoCompilerArgs =
args::getStrings(args, OPT_thinlto_remote_compiler_arg);

// Handle /dwodir
config->dwoDir = args.getLastArgValue(OPT_dwodir);
Expand Down
4 changes: 2 additions & 2 deletions lld/COFF/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ def thinlto_distributor : P<"thinlto-distributor",
"backend compilations will be distributed">;
def thinlto_distributor_arg : P<"thinlto-distributor-arg",
"Arguments to pass to the ThinLTO distributor">;
def thinlto_compiler : P<"thinlto-remote-compiler",
def thinlto_remote_compiler : P<"thinlto-remote-compiler",
"Compiler for the ThinLTO distributor to invoke for ThinLTO backend "
"compilations">;
def thinlto_compiler_arg : P<"thinlto-remote-compiler-arg",
def thinlto_remote_compiler_arg : P<"thinlto-remote-compiler-arg",
"Compiler arguments for the ThinLTO distributor to pass for ThinLTO backend "
"compilations">;
def lto_obj_path : P<
Expand Down
5 changes: 3 additions & 2 deletions lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,9 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
ctx.arg.dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor_eq);
ctx.arg.dtltoDistributorArgs =
args::getStrings(args, OPT_thinlto_distributor_arg);
ctx.arg.dtltoCompiler = args.getLastArgValue(OPT_thinlto_compiler_eq);
ctx.arg.dtltoCompilerArgs = args::getStrings(args, OPT_thinlto_compiler_arg);
ctx.arg.dtltoCompiler = args.getLastArgValue(OPT_thinlto_remote_compiler_eq);
ctx.arg.dtltoCompilerArgs =
args::getStrings(args, OPT_thinlto_remote_compiler_arg);
ctx.arg.dwoDir = args.getLastArgValue(OPT_plugin_opt_dwo_dir_eq);
ctx.arg.dynamicLinker = getDynamicLinker(ctx, args);
ctx.arg.ehFrameHdr =
Expand Down
6 changes: 3 additions & 3 deletions lld/ELF/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,11 @@ def thinlto_distributor_eq: JJ<"thinlto-distributor=">,
"ThinLTO backend compilations will be distributed">;
defm thinlto_distributor_arg: EEq<"thinlto-distributor-arg", "Arguments to "
"pass to the ThinLTO distributor">;
def thinlto_compiler_eq: JJ<"thinlto-remote-compiler=">,
def thinlto_remote_compiler_eq: JJ<"thinlto-remote-compiler=">,
HelpText<"Compiler for the ThinLTO distributor to invoke for ThinLTO backend "
"compilations">;
defm thinlto_compiler_arg: EEq<"thinlto-remote-compiler-arg", "Compiler "
"arguments for the ThinLTO distributor to pass for ThinLTO backend "
defm thinlto_remote_compiler_arg: EEq<"thinlto-remote-compiler-arg",
"Compiler arguments for the ThinLTO distributor to pass for ThinLTO backend "
"compilations">;
defm fat_lto_objects: BB<"fat-lto-objects",
"Use the .llvm.lto section, which contains LLVM bitcode, in fat LTO object files to perform LTO.",
Expand Down