66
66
#include " clang/Driver/Tool.h"
67
67
#include " clang/Driver/ToolChain.h"
68
68
#include " clang/Driver/Types.h"
69
- #include " clang/Lex/DependencyDirectivesScanner.h"
70
69
#include " llvm/ADT/ArrayRef.h"
71
70
#include " llvm/ADT/STLExtras.h"
72
71
#include " llvm/ADT/StringExtras.h"
@@ -4291,12 +4290,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
4291
4290
YcArg = nullptr ;
4292
4291
}
4293
4292
4294
- if (Args.hasArgNoClaim (options::OPT_fmodules_driver))
4295
- // TODO: Check against all incompatible -fmodules-driver arguments
4296
- if (!ModulesModeCXX20) {
4297
- Args.eraseArg (options::OPT_fmodules_driver);
4298
- }
4299
-
4300
4293
Arg *FinalPhaseArg;
4301
4294
phases::ID FinalPhase = getFinalPhase (Args, &FinalPhaseArg);
4302
4295
@@ -4423,35 +4416,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
4423
4416
}
4424
4417
}
4425
4418
4426
- static bool hasCXXModuleInputType (const Driver::InputList &Inputs) {
4427
- const auto IsTypeCXXModule = [](const auto &Input) -> bool {
4428
- const auto TypeID = Input.first ;
4429
- return (TypeID == types::TY_CXXModule);
4430
- };
4431
- return llvm::any_of (Inputs, IsTypeCXXModule);
4432
- }
4433
-
4434
- llvm::ErrorOr<bool >
4435
- Driver::ScanInputsForCXX20ModulesUsage (const InputList &Inputs) const {
4436
- const auto CXXInputs = llvm::make_filter_range (
4437
- Inputs, [](const auto &Input) { return types::isCXX (Input.first ); });
4438
-
4439
- for (const auto &Input : CXXInputs) {
4440
- StringRef Filename = Input.second ->getSpelling ();
4441
- auto ErrOrBuffer = VFS->getBufferForFile (Filename);
4442
- if (!ErrOrBuffer)
4443
- return ErrOrBuffer.getError ();
4444
- const auto Buffer = std::move (*ErrOrBuffer);
4445
-
4446
- if (scanInputForCXX20ModulesUsage (Buffer->getBuffer ())) {
4447
- Diags.Report (diag::remark_found_cxx20_module_usage) << Filename;
4448
- return true ;
4449
- }
4450
- }
4451
-
4452
- return false ;
4453
- }
4454
-
4455
4419
void Driver::BuildActions (Compilation &C, DerivedArgList &Args,
4456
4420
const InputList &Inputs, ActionList &Actions) const {
4457
4421
llvm::PrettyStackTraceString CrashInfo (" Building compilation actions" );
@@ -4463,33 +4427,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
4463
4427
4464
4428
handleArguments (C, Args, Inputs, Actions);
4465
4429
4466
- if (Args.hasFlag (options::OPT_fmodules_driver,
4467
- options::OPT_fno_modules_driver, false )) {
4468
- // TODO: Move the logic for implicitly enabling explicit-module-builds out
4469
- // of -fmodules-driver once it is no longer experimental.
4470
- // Currently, this serves diagnostic purposes only.
4471
- bool UsesCXXModules = hasCXXModuleInputType (Inputs);
4472
- if (!UsesCXXModules) {
4473
- const auto ErrOrScanResult = ScanInputsForCXX20ModulesUsage (Inputs);
4474
- if (!ErrOrScanResult) {
4475
- Diags.Report (diag::err_cannot_open_file)
4476
- << ErrOrScanResult.getError ().message ();
4477
- return ;
4478
- }
4479
- UsesCXXModules = *ErrOrScanResult;
4480
- }
4481
- if (UsesCXXModules)
4482
- BuildDriverManagedModuleBuildActions (C, Args, Inputs, Actions);
4483
- return ;
4484
- }
4485
-
4486
- BuildDefaultActions (C, Args, Inputs, Actions);
4487
- }
4488
-
4489
- void Driver::BuildDefaultActions (Compilation &C, DerivedArgList &Args,
4490
- const InputList &Inputs,
4491
- ActionList &Actions) const {
4492
-
4493
4430
bool UseNewOffloadingDriver =
4494
4431
C.isOffloadingHostKind (Action::OFK_OpenMP) ||
4495
4432
C.isOffloadingHostKind (Action::OFK_SYCL) ||
@@ -4773,13 +4710,6 @@ void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args,
4773
4710
Args.ClaimAllArgs (options::OPT_cl_ignored_Group);
4774
4711
}
4775
4712
4776
- void Driver::BuildDriverManagedModuleBuildActions (
4777
- Compilation &C, llvm::opt::DerivedArgList &Args, const InputList &Inputs,
4778
- ActionList &Actions) const {
4779
- Diags.Report (diag::remark_performing_driver_managed_module_build);
4780
- return ;
4781
- }
4782
-
4783
4713
// / Returns the canonical name for the offloading architecture when using a HIP
4784
4714
// / or CUDA architecture.
4785
4715
static StringRef getCanonicalArchString (Compilation &C,
0 commit comments