@@ -4210,8 +4210,7 @@ static bool ContainsWrapperAction(const Action *A) {
4210
4210
void Clang::ConstructHostCompilerJob (Compilation &C, const JobAction &JA,
4211
4211
const InputInfo &Output,
4212
4212
const InputInfoList &Inputs,
4213
- const llvm::opt::ArgList &TCArgs,
4214
- const Tool *T) const {
4213
+ const llvm::opt::ArgList &TCArgs) const {
4215
4214
4216
4215
// The Host compilation step that occurs here is constructed based on the
4217
4216
// input from the user. This consists of the compiler to call and the
@@ -4224,7 +4223,7 @@ void Clang::ConstructHostCompilerJob(Compilation &C, const JobAction &JA,
4224
4223
HostCompileArgs.push_back (InputFile.getFilename ());
4225
4224
4226
4225
// When performing the host compilation, we are expecting to only be
4227
- // creating intermediate files. These being preprocessed , assembly or
4226
+ // creating intermediate files, namely preprocessor output , assembly or
4228
4227
// object files.
4229
4228
// We are making assumptions in regards to what options are used to
4230
4229
// generate these intermediate files.
@@ -4257,6 +4256,9 @@ void Clang::ConstructHostCompilerJob(Compilation &C, const JobAction &JA,
4257
4256
};
4258
4257
// FIXME: Reuse existing toolchains which are already supported to put
4259
4258
// together the options.
4259
+ // FIXME: For any potential obscure host compilers that do not use the
4260
+ // 'standard' set of options, we should provide a user interface that allows
4261
+ // users to override the implied options.
4260
4262
if (isa<PreprocessJobAction>(JA)) {
4261
4263
if (IsMSVCHostCompiler) {
4262
4264
// Check the output file, if it is 'stdout' we want to use -E.
@@ -4341,6 +4343,7 @@ void Clang::ConstructHostCompilerJob(Compilation &C, const JobAction &JA,
4341
4343
llvm::transform (TargetArgs, std::back_inserter (HostCompileArgs),
4342
4344
[&TCArgs](StringRef A) { return TCArgs.MakeArgString (A); });
4343
4345
}
4346
+ const Tool *T = TC.SelectTool (JA);
4344
4347
auto Cmd = std::make_unique<Command>(JA, *T, ResponseFileSupport::None (),
4345
4348
TCArgs.MakeArgString (ExecPath),
4346
4349
HostCompileArgs, None);
@@ -4381,11 +4384,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4381
4384
IsHeaderModulePrecompile || Inputs.size () == 1 ) &&
4382
4385
" Unable to handle multiple inputs." );
4383
4386
4384
- // Perform the host compilation using an external compiler if the user
4387
+ // Perform the SYCL host compilation using an external compiler if the user
4385
4388
// requested.
4386
4389
if (Args.hasArg (options::OPT_fsycl_host_compiler_EQ) && IsSYCL &&
4387
4390
!IsSYCLOffloadDevice) {
4388
- ConstructHostCompilerJob (C, JA, Output, Inputs, Args, this );
4391
+ ConstructHostCompilerJob (C, JA, Output, Inputs, Args);
4389
4392
return ;
4390
4393
}
4391
4394
0 commit comments