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"
@@ -4294,12 +4293,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
42944293 YcArg = nullptr ;
42954294 }
42964295
4297- if (Args.hasArgNoClaim (options::OPT_fmodules_driver))
4298- // TODO: Check against all incompatible -fmodules-driver arguments
4299- if (!ModulesModeCXX20) {
4300- Args.eraseArg (options::OPT_fmodules_driver);
4301- }
4302-
43034296 Arg *FinalPhaseArg;
43044297 phases::ID FinalPhase = getFinalPhase (Args, &FinalPhaseArg);
43054298
@@ -4426,35 +4419,6 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args,
44264419 }
44274420}
44284421
4429- static bool hasCXXModuleInputType (const Driver::InputList &Inputs) {
4430- const auto IsTypeCXXModule = [](const auto &Input) -> bool {
4431- const auto TypeID = Input.first ;
4432- return (TypeID == types::TY_CXXModule);
4433- };
4434- return llvm::any_of (Inputs, IsTypeCXXModule);
4435- }
4436-
4437- llvm::ErrorOr<bool >
4438- Driver::ScanInputsForCXX20ModulesUsage (const InputList &Inputs) const {
4439- const auto CXXInputs = llvm::make_filter_range (
4440- Inputs, [](const auto &Input) { return types::isCXX (Input.first ); });
4441-
4442- for (const auto &Input : CXXInputs) {
4443- StringRef Filename = Input.second ->getSpelling ();
4444- auto ErrOrBuffer = VFS->getBufferForFile (Filename);
4445- if (!ErrOrBuffer)
4446- return ErrOrBuffer.getError ();
4447- const auto Buffer = std::move (*ErrOrBuffer);
4448-
4449- if (scanInputForCXX20ModulesUsage (Buffer->getBuffer ())) {
4450- Diags.Report (diag::remark_found_cxx20_module_usage) << Filename;
4451- return true ;
4452- }
4453- }
4454-
4455- return false ;
4456- }
4457-
44584422void Driver::BuildActions (Compilation &C, DerivedArgList &Args,
44594423 const InputList &Inputs, ActionList &Actions) const {
44604424 llvm::PrettyStackTraceString CrashInfo (" Building compilation actions" );
@@ -4466,33 +4430,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
44664430
44674431 handleArguments (C, Args, Inputs, Actions);
44684432
4469- if (Args.hasFlag (options::OPT_fmodules_driver,
4470- options::OPT_fno_modules_driver, false )) {
4471- // TODO: Move the logic for implicitly enabling explicit-module-builds out
4472- // of -fmodules-driver once it is no longer experimental.
4473- // Currently, this serves diagnostic purposes only.
4474- bool UsesCXXModules = hasCXXModuleInputType (Inputs);
4475- if (!UsesCXXModules) {
4476- const auto ErrOrScanResult = ScanInputsForCXX20ModulesUsage (Inputs);
4477- if (!ErrOrScanResult) {
4478- Diags.Report (diag::err_cannot_open_file)
4479- << ErrOrScanResult.getError ().message ();
4480- return ;
4481- }
4482- UsesCXXModules = *ErrOrScanResult;
4483- }
4484- if (UsesCXXModules)
4485- BuildDriverManagedModuleBuildActions (C, Args, Inputs, Actions);
4486- return ;
4487- }
4488-
4489- BuildDefaultActions (C, Args, Inputs, Actions);
4490- }
4491-
4492- void Driver::BuildDefaultActions (Compilation &C, DerivedArgList &Args,
4493- const InputList &Inputs,
4494- ActionList &Actions) const {
4495-
44964433 bool UseNewOffloadingDriver =
44974434 C.isOffloadingHostKind (Action::OFK_OpenMP) ||
44984435 C.isOffloadingHostKind (Action::OFK_SYCL) ||
@@ -4776,13 +4713,6 @@ void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args,
47764713 Args.ClaimAllArgs (options::OPT_cl_ignored_Group);
47774714}
47784715
4779- void Driver::BuildDriverManagedModuleBuildActions (
4780- Compilation &C, llvm::opt::DerivedArgList &Args, const InputList &Inputs,
4781- ActionList &Actions) const {
4782- Diags.Report (diag::remark_performing_driver_managed_module_build);
4783- return ;
4784- }
4785-
47864716// / Returns the canonical name for the offloading architecture when using a HIP
47874717// / or CUDA architecture.
47884718static StringRef getCanonicalArchString (Compilation &C,
0 commit comments