Skip to content

Commit d68f0c2

Browse files
authored
[DTLTO][LLD] Tidy up DTLTO related options (NFC) (#161675)
Change LLD DTLTO option definitions to match actual option name.
1 parent 5843ffb commit d68f0c2

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

lld/COFF/Driver.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,18 +2104,18 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
21042104
config->dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor);
21052105

21062106
// Handle /thinlto-distributor-arg:<arg>
2107-
for (auto *arg : args.filtered(OPT_thinlto_distributor_arg))
2108-
config->dtltoDistributorArgs.push_back(arg->getValue());
2107+
config->dtltoDistributorArgs =
2108+
args::getStrings(args, OPT_thinlto_distributor_arg);
21092109

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

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

21202120
// Handle /dwodir
21212121
config->dwoDir = args.getLastArgValue(OPT_dwodir);

lld/COFF/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ def thinlto_distributor : P<"thinlto-distributor",
289289
"backend compilations will be distributed">;
290290
def thinlto_distributor_arg : P<"thinlto-distributor-arg",
291291
"Arguments to pass to the ThinLTO distributor">;
292-
def thinlto_compiler : P<"thinlto-remote-compiler",
292+
def thinlto_remote_compiler : P<"thinlto-remote-compiler",
293293
"Compiler for the ThinLTO distributor to invoke for ThinLTO backend "
294294
"compilations">;
295-
def thinlto_compiler_arg : P<"thinlto-remote-compiler-arg",
295+
def thinlto_remote_compiler_arg : P<"thinlto-remote-compiler-arg",
296296
"Compiler arguments for the ThinLTO distributor to pass for ThinLTO backend "
297297
"compilations">;
298298
def lto_obj_path : P<

lld/ELF/Driver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,9 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
13991399
ctx.arg.dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor_eq);
14001400
ctx.arg.dtltoDistributorArgs =
14011401
args::getStrings(args, OPT_thinlto_distributor_arg);
1402-
ctx.arg.dtltoCompiler = args.getLastArgValue(OPT_thinlto_compiler_eq);
1403-
ctx.arg.dtltoCompilerArgs = args::getStrings(args, OPT_thinlto_compiler_arg);
1402+
ctx.arg.dtltoCompiler = args.getLastArgValue(OPT_thinlto_remote_compiler_eq);
1403+
ctx.arg.dtltoCompilerArgs =
1404+
args::getStrings(args, OPT_thinlto_remote_compiler_arg);
14041405
ctx.arg.dwoDir = args.getLastArgValue(OPT_plugin_opt_dwo_dir_eq);
14051406
ctx.arg.dynamicLinker = getDynamicLinker(ctx, args);
14061407
ctx.arg.ehFrameHdr =

lld/ELF/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,11 @@ def thinlto_distributor_eq: JJ<"thinlto-distributor=">,
722722
"ThinLTO backend compilations will be distributed">;
723723
defm thinlto_distributor_arg: EEq<"thinlto-distributor-arg", "Arguments to "
724724
"pass to the ThinLTO distributor">;
725-
def thinlto_compiler_eq: JJ<"thinlto-remote-compiler=">,
725+
def thinlto_remote_compiler_eq: JJ<"thinlto-remote-compiler=">,
726726
HelpText<"Compiler for the ThinLTO distributor to invoke for ThinLTO backend "
727727
"compilations">;
728-
defm thinlto_compiler_arg: EEq<"thinlto-remote-compiler-arg", "Compiler "
729-
"arguments for the ThinLTO distributor to pass for ThinLTO backend "
728+
defm thinlto_remote_compiler_arg: EEq<"thinlto-remote-compiler-arg",
729+
"Compiler arguments for the ThinLTO distributor to pass for ThinLTO backend "
730730
"compilations">;
731731
defm fat_lto_objects: BB<"fat-lto-objects",
732732
"Use the .llvm.lto section, which contains LLVM bitcode, in fat LTO object files to perform LTO.",

0 commit comments

Comments
 (0)