Merge commit '3eb82c183662945687f48e11c09828f551b34858' into master-next

# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
This commit is contained in:
Karoy Lorentey
2020-06-08 16:58:37 -07:00
580 changed files with 9388 additions and 3418 deletions

View File

@@ -2190,6 +2190,30 @@ TypeDecl *ModuleFile::lookupLocalType(StringRef MangledName) {
return cast<TypeDecl>(getDecl(*iter));
}
std::unique_ptr<llvm::MemoryBuffer>
ModuleFile::getModuleName(ASTContext &Ctx, StringRef modulePath,
std::string &Name) {
// Open the module file
auto &fs = *Ctx.SourceMgr.getFileSystem();
auto moduleBuf = fs.getBufferForFile(modulePath);
if (!moduleBuf)
return nullptr;
// Load the module file without validation.
std::unique_ptr<ModuleFile> loadedModuleFile;
ExtendedValidationInfo ExtInfo;
bool isFramework = false;
serialization::ValidationInfo loadInfo =
ModuleFile::load(modulePath.str(),
std::move(moduleBuf.get()),
nullptr,
nullptr,
/*isFramework*/isFramework, loadedModuleFile,
&ExtInfo);
Name = loadedModuleFile->Name;
return std::move(loadedModuleFile->ModuleInputBuffer);
}
OpaqueTypeDecl *ModuleFile::lookupOpaqueResultType(StringRef MangledName) {
PrettyStackTraceModuleFile stackEntry(*this);