6666#include " clang/Driver/Tool.h"
6767#include " clang/Driver/ToolChain.h"
6868#include " clang/Driver/Types.h"
69- #include " clang/Lex/DependencyDirectivesScanner.h"
7069#include " llvm/ADT/ArrayRef.h"
7170#include " llvm/ADT/STLExtras.h"
7271#include " llvm/ADT/StringExtras.h"
@@ -4291,12 +4290,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
42914290 YcArg = nullptr ;
42924291 }
42934292
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-
43004293 Arg *FinalPhaseArg;
43014294 phases::ID FinalPhase = getFinalPhase (Args, &FinalPhaseArg);
43024295
@@ -4423,35 +4416,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
44234416 }
44244417}
44254418
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-
44554419void Driver::BuildActions (Compilation &C, DerivedArgList &Args,
44564420 const InputList &Inputs, ActionList &Actions) const {
44574421 llvm::PrettyStackTraceString CrashInfo (" Building compilation actions" );
@@ -4463,33 +4427,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
44634427
44644428 handleArguments (C, Args, Inputs, Actions);
44654429
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-
44934430 bool UseNewOffloadingDriver =
44944431 C.isOffloadingHostKind (Action::OFK_OpenMP) ||
44954432 C.isOffloadingHostKind (Action::OFK_SYCL) ||
@@ -4773,13 +4710,6 @@ void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args,
47734710 Args.ClaimAllArgs (options::OPT_cl_ignored_Group);
47744711}
47754712
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-
47834713// / Returns the canonical name for the offloading architecture when using a HIP
47844714// / or CUDA architecture.
47854715static StringRef getCanonicalArchString (Compilation &C,
0 commit comments