Skip to content

Commit 7525a13

Browse files
committed
Make thinlto-remote-compiler a cl::opt
1 parent f5cb455 commit 7525a13

File tree

25 files changed

+34
-59
lines changed

25 files changed

+34
-59
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
543543
CmdArgs.push_back(
544544
Args.MakeArgString("--thinlto-distributor=" + Twine(A->getValue())));
545545
CmdArgs.push_back(
546-
Args.MakeArgString("--thinlto-remote-compiler=" +
546+
Args.MakeArgString("-mllvm=-thinlto-remote-compiler=" +
547547
Twine(ToolChain.getDriver().getClangProgramPath())));
548548

549549
for (auto A : Args.getAllArgValues(options::OPT_Xthinlto_distributor_EQ))

clang/test/Driver/DTLTO/dtlto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// CHECK: ld.lld
1616
// CHECK-SAME: "--thinlto-distributor=dist.exe"
17-
// CHECK-SAME: "--thinlto-remote-compiler={{.*}}clang
17+
// CHECK-SAME: "-mllvm=-thinlto-remote-compiler={{.*}}clang
1818
// CHECK-SAME: "-mllvm=-thinlto-distributor-arg=distarg1"
1919
// CHECK-SAME: "-mllvm=-thinlto-distributor-arg=distarg2"
2020
// CHECK-SAME: "-mllvm=-thinlto-distributor-arg=distarg3"
@@ -30,7 +30,7 @@
3030
// NONE: warning: argument unused during compilation: '-Xthinlto-distributor=distarg2,distarg3'
3131
// NONE: ld.lld
3232
// NOMORE-NOT: --thinlto-distributor=
33-
// NOMORE-NOT: --thinlto-remote-compiler=
33+
// NOMORE-NOT: -thinlto-remote-compiler=
3434
// NOMORE-NOT: -mllvm
3535
// NOMORE-NOT: -thinlto-distributor-arg=
3636

@@ -43,4 +43,4 @@
4343

4444
// DEFAULT: ld.lld
4545
// DEFAULT-SAME: "--thinlto-distributor=dist.exe"
46-
// DEFAULT-SAME: "--thinlto-remote-compiler={{.*}}clang
46+
// DEFAULT-SAME: "-mllvm=-thinlto-remote-compiler={{.*}}clang

cross-project-tests/dtlto/dtlto-translate-options.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929

3030
; RUN: echo "x86_64-unknown-linux-gnu.bc -o x86_64-unknown-linux-gnu.o \
3131
; RUN: -dtlto \
32-
; RUN: -dtlto-remote-compiler=%clang \
33-
; RUN: -thinlto-remote-compiler-arg=-Werror \
3432
; RUN: -dtlto-distributor=%python \
33+
; RUN: -thinlto-remote-compiler=%clang \
34+
; RUN: -thinlto-remote-compiler-arg=-Werror \
3535
; RUN: -r=x86_64-unknown-linux-gnu.bc,globalfunc1,plx" > x86_64-unknown-linux-gnu.rsp
3636

3737
; RUN: echo "x86_64-pc-windows-msvc.bc -o x86_64-pc-windows-msvc.o \
3838
; RUN: -dtlto \
39-
; RUN: -dtlto-remote-compiler=%clang \
39+
; RUN: -dtlto-distributor=%python \
40+
; RUN: -thinlto-remote-compiler=%clang \
4041
; RUN: -thinlto-remote-compiler-arg=-Werror \
4142
; RUN: -thinlto-remote-compiler-arg=-Wno-override-module \
42-
; RUN: -dtlto-distributor=%python \
4343
; RUN: -r=x86_64-pc-windows-msvc.bc,globalfunc2,plx" > x86_64-pc-windows-msvc.rsp
4444

4545

lld/COFF/Config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ struct Configuration {
194194

195195
// Used for --thinlto-distributor=
196196
StringRef dtltoDistributor;
197-
// Used for --thinlto-remote-compiler=
198-
StringRef dtltoRemoteCompiler;
199197

200198
// Used for /opt:[no]ltodebugpassmanager
201199
bool ltoDebugPassManager = false;

lld/COFF/Driver.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,8 +2091,6 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
20912091

20922092
// Handle DTLTO options.
20932093
config->dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor_eq);
2094-
config->dtltoRemoteCompiler =
2095-
args.getLastArgValue(OPT_thinlto_remote_compiler_eq);
20962094

20972095
// Handle /dwodir
20982096
config->dwoDir = args.getLastArgValue(OPT_dwodir);

lld/COFF/LTO.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ BitcodeCompiler::BitcodeCompiler(COFFLinkerContext &c) : ctx(c) {
123123
/*OnWrite=*/nullptr,
124124
/*ShouldEmitIndexFiles=*/false,
125125
/*ShouldEmitImportFiles=*/false, ctx.config.outputFile,
126-
ctx.config.dtltoRemoteCompiler, ctx.config.dtltoDistributor,
127-
!ctx.config.saveTempsArgs.empty());
126+
ctx.config.dtltoDistributor, !ctx.config.saveTempsArgs.empty());
128127
} else if (ctx.config.thinLTOIndexOnly) {
129128
auto OnIndexWrite = [&](StringRef S) { thinIndices.erase(S); };
130129
backend = lto::createWriteIndexesThinBackend(

lld/COFF/Options.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ def thinlto_prefix_replace: P<
272272
"'old;new' replace old prefix with new prefix in ThinLTO outputs">;
273273
def thinlto_distributor_eq: Joined<["--"], "thinlto-distributor=">,
274274
HelpText<"Distributor to use for ThinLTO backend compilations">;
275-
def thinlto_remote_compiler_eq: Joined<["--"], "thinlto-remote-compiler=">,
276-
HelpText<"Optimization tool to be invoked by the ThinLTO distributor">;
277275
def lto_obj_path : P<
278276
"lto-obj-path",
279277
"output native object for merged LTO unit to this path">;

lld/ELF/Config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ struct Config {
244244
llvm::SmallVector<llvm::StringRef, 0> symbolOrderingFile;
245245
llvm::SmallVector<llvm::StringRef, 0> thinLTOModulesToCompile;
246246
llvm::StringRef dtltoDistributor;
247-
llvm::StringRef dtltoRemoteCompiler;
248247
llvm::SmallVector<llvm::StringRef, 0> undefined;
249248
llvm::SmallVector<SymbolVersion, 0> dynamicList;
250249
llvm::SmallVector<uint8_t, 0> buildIdVector;

lld/ELF/Driver.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,6 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
13421342
ctx.arg.disableVerify = args.hasArg(OPT_disable_verify);
13431343
ctx.arg.discard = getDiscard(args);
13441344
ctx.arg.dtltoDistributor = args.getLastArgValue(OPT_thinlto_distributor_eq);
1345-
ctx.arg.dtltoRemoteCompiler =
1346-
args.getLastArgValue(OPT_thinlto_remote_compiler_eq);
13471345
ctx.arg.dwoDir = args.getLastArgValue(OPT_plugin_opt_dwo_dir_eq);
13481346
ctx.arg.dynamicLinker = getDynamicLinker(ctx, args);
13491347
ctx.arg.ehFrameHdr =

lld/ELF/LTO.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ BitcodeCompiler::BitcodeCompiler(Ctx &ctx) : ctx(ctx) {
192192
llvm::heavyweight_hardware_concurrency(ctx.arg.thinLTOJobs),
193193
onIndexWrite, ctx.arg.thinLTOEmitIndexFiles,
194194
ctx.arg.thinLTOEmitImportsFiles, ctx.arg.outputFile,
195-
ctx.arg.dtltoRemoteCompiler, ctx.arg.dtltoDistributor,
196-
!ctx.arg.saveTempsArgs.empty());
195+
ctx.arg.dtltoDistributor, !ctx.arg.saveTempsArgs.empty());
197196
} else {
198197
backend = lto::createInProcessThinBackend(
199198
llvm::heavyweight_hardware_concurrency(ctx.arg.thinLTOJobs),

0 commit comments

Comments
 (0)