@@ -4539,7 +4539,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4539
4539
bool IsHIP = JA.isOffloading (Action::OFK_HIP);
4540
4540
bool IsHIPDevice = JA.isDeviceOffloading (Action::OFK_HIP);
4541
4541
bool IsOpenMPDevice = JA.isDeviceOffloading (Action::OFK_OpenMP);
4542
- bool IsHeaderModulePrecompile = isa<HeaderModulePrecompileJobAction>(JA);
4543
4542
bool IsExtractAPI = isa<ExtractAPIJobAction>(JA);
4544
4543
bool IsDeviceOffloadAction = !(JA.isDeviceOffloading (Action::OFK_None) ||
4545
4544
JA.isDeviceOffloading (Action::OFK_Host));
@@ -4554,44 +4553,24 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4554
4553
bool IsUsingLTO = D.isUsingLTO (IsDeviceOffloadAction);
4555
4554
auto LTOMode = D.getLTOMode (IsDeviceOffloadAction);
4556
4555
4557
- // A header module compilation doesn't have a main input file, so invent a
4558
- // fake one as a placeholder.
4559
- const char *ModuleName = [&] {
4560
- auto *ModuleNameArg = Args.getLastArg (options::OPT_fmodule_name_EQ);
4561
- return ModuleNameArg ? ModuleNameArg->getValue () : " " ;
4562
- }();
4563
- InputInfo HeaderModuleInput (Inputs[0 ].getType (), ModuleName, ModuleName);
4564
-
4565
4556
// Extract API doesn't have a main input file, so invent a fake one as a
4566
4557
// placeholder.
4567
4558
InputInfo ExtractAPIPlaceholderInput (Inputs[0 ].getType (), " extract-api" ,
4568
4559
" extract-api" );
4569
4560
4570
4561
const InputInfo &Input = [&]() -> const InputInfo & {
4571
- if (IsHeaderModulePrecompile)
4572
- return HeaderModuleInput;
4573
4562
if (IsExtractAPI)
4574
4563
return ExtractAPIPlaceholderInput;
4575
4564
return Inputs[0 ];
4576
4565
}();
4577
4566
4578
- InputInfoList ModuleHeaderInputs;
4579
4567
InputInfoList ExtractAPIInputs;
4580
4568
InputInfoList HostOffloadingInputs;
4581
4569
const InputInfo *CudaDeviceInput = nullptr ;
4582
4570
const InputInfo *OpenMPDeviceInput = nullptr ;
4583
4571
for (const InputInfo &I : Inputs) {
4584
4572
if (&I == &Input || I.getType () == types::TY_Nothing) {
4585
4573
// This is the primary input or contains nothing.
4586
- } else if (IsHeaderModulePrecompile &&
4587
- types::getPrecompiledType (I.getType ()) == types::TY_PCH) {
4588
- types::ID Expected = HeaderModuleInput.getType ();
4589
- if (I.getType () != Expected) {
4590
- D.Diag (diag::err_drv_module_header_wrong_kind)
4591
- << I.getFilename () << types::getTypeName (I.getType ())
4592
- << types::getTypeName (Expected);
4593
- }
4594
- ModuleHeaderInputs.push_back (I);
4595
4574
} else if (IsExtractAPI) {
4596
4575
auto ExpectedInputType = ExtractAPIPlaceholderInput.getType ();
4597
4576
if (I.getType () != ExpectedInputType) {
@@ -4779,9 +4758,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
4779
4758
if (JA.getType () == types::TY_Nothing)
4780
4759
CmdArgs.push_back (" -fsyntax-only" );
4781
4760
else if (JA.getType () == types::TY_ModuleFile)
4782
- CmdArgs.push_back (IsHeaderModulePrecompile
4783
- ? " -emit-header-module"
4784
- : " -emit-module-interface" );
4761
+ CmdArgs.push_back (" -emit-module-interface" );
4785
4762
else if (JA.getType () == types::TY_HeaderUnit)
4786
4763
CmdArgs.push_back (" -emit-header-unit" );
4787
4764
else
@@ -7376,9 +7353,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
7376
7353
addDashXForInput (Args, Input, CmdArgs);
7377
7354
7378
7355
ArrayRef<InputInfo> FrontendInputs = Input;
7379
- if (IsHeaderModulePrecompile)
7380
- FrontendInputs = ModuleHeaderInputs;
7381
- else if (IsExtractAPI)
7356
+ if (IsExtractAPI)
7382
7357
FrontendInputs = ExtractAPIInputs;
7383
7358
else if (Input.isNothing ())
7384
7359
FrontendInputs = {};
0 commit comments