@@ -2687,41 +2687,6 @@ bool ExplicitCASModuleLoader::findModule(
26872687 return false ;
26882688 }
26892689
2690- const bool isForwardingModule =
2691- !serialization::isSerializedAST (moduleBuf->getBuffer ());
2692- // If the module is a forwarding module, read the actual content from the path
2693- // encoded in the forwarding module as the actual module content.
2694- if (isForwardingModule) {
2695- auto forwardingModule = ForwardingModule::load (*moduleBuf.get ());
2696- if (forwardingModule) {
2697- // Look through ExplicitModuleMap for paths.
2698- // TODO: need to have dependency scanner reports forwarded module as
2699- // dependency for this compilation and ingested into CAS.
2700- auto moduleOrErr = Impl.loadModuleFromPath (
2701- forwardingModule->underlyingModulePath , Ctx.Diags );
2702- if (!moduleOrErr) {
2703- llvm::consumeError (moduleOrErr.takeError ());
2704- Ctx.Diags .diagnose (SourceLoc (),
2705- diag::error_opening_explicit_module_file,
2706- moduleInfo.modulePath );
2707- return false ;
2708- }
2709- moduleBuf = std::move (*moduleOrErr);
2710- if (!moduleBuf) {
2711- // We cannot read the module content, diagnose.
2712- Ctx.Diags .diagnose (SourceLoc (),
2713- diag::error_opening_explicit_module_file,
2714- moduleInfo.modulePath );
2715- return false ;
2716- }
2717- } else {
2718- // We cannot read the module content, diagnose.
2719- Ctx.Diags .diagnose (SourceLoc (), diag::error_opening_explicit_module_file,
2720- moduleInfo.modulePath );
2721- return false ;
2722- }
2723- }
2724- assert (moduleBuf);
27252690 // Move the opened module buffer to the caller.
27262691 *ModuleBuffer = std::move (moduleBuf);
27272692
0 commit comments