[ParseableInterface] Only open module buffers once while loading

In addition to being wasteful, this is a correctness issue -- the
compiler should only ever have one view of this file, and it should not
read a potentially different file after validating dependencies.

rdar://48654608
This commit is contained in:
Harlan Haskins
2019-03-07 16:52:53 -08:00
parent 384882d5f3
commit f4da34f363
5 changed files with 170 additions and 66 deletions

View File

@@ -63,6 +63,11 @@ protected:
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer);
std::error_code
openModuleDocFile(AccessPathElem ModuleID,
StringRef ModuleDocPath,
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer);
/// If the module loader subclass knows that all options have been tried for
/// loading an architecture-specific file out of a swiftmodule bundle, try
/// to list the architectures that \e are present.