mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Explicit Module Builds] Prevent SerializedModuleLoader from running in Explicit Module Build mode.
In order to avoid accidentally implicitly loading modules that are expected but were not provided as explicit inputs. - Use either SerializedModuleLoader or ExplicitSwiftModuleLoader for loading of partial modules, depending on whether we are in Explicit Module Build or Implicit Module Build mode.
This commit is contained in:
@@ -211,12 +211,12 @@ static void indexModule(llvm::MemoryBuffer *Input,
|
||||
CompilerInstance &CI,
|
||||
ArrayRef<const char *> Args) {
|
||||
ASTContext &Ctx = CI.getASTContext();
|
||||
std::unique_ptr<SerializedModuleLoader> Loader;
|
||||
std::unique_ptr<ImplicitSerializedModuleLoader> Loader;
|
||||
ModuleDecl *Mod = nullptr;
|
||||
if (ModuleName == Ctx.StdlibModuleName.str()) {
|
||||
Mod = Ctx.getModule({ {Ctx.StdlibModuleName, SourceLoc()} });
|
||||
} else {
|
||||
Loader = SerializedModuleLoader::create(Ctx);
|
||||
Loader = ImplicitSerializedModuleLoader::create(Ctx);
|
||||
auto Buf = std::unique_ptr<llvm::MemoryBuffer>(
|
||||
llvm::MemoryBuffer::getMemBuffer(Input->getBuffer(),
|
||||
Input->getBufferIdentifier()));
|
||||
|
||||
Reference in New Issue
Block a user