[ParseableInterface] Pass down the module name and import source loc

- Use the name for the cached module, so that we don't end up with a
  zillion "x86_64-XXXXXXXX.swiftmodule" files in the cache when we're
  working with architecture-specific swiftmodules.

- Diagnose if the expected name is different from the name specified
  in the swiftinterface.

- Emit all diagnostics at the location of the import, instead of
  without any location at all.
This commit is contained in:
Jordan Rose
2018-12-05 16:30:11 -08:00
parent 06f3c11377
commit a51f1dd3d2
6 changed files with 82 additions and 47 deletions

View File

@@ -52,8 +52,8 @@ protected:
bool &isFramework);
virtual std::error_code
openModuleFiles(StringRef DirName, StringRef ModuleFilename,
StringRef ModuleDocFilename,
openModuleFiles(AccessPathElem ModuleID, StringRef DirName,
StringRef ModuleFilename, StringRef ModuleDocFilename,
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
llvm::SmallVectorImpl<char> &Scratch);
@@ -129,8 +129,8 @@ class SerializedModuleLoader : public SerializedModuleLoaderBase {
{}
std::error_code
openModuleFiles(StringRef DirName, StringRef ModuleFilename,
StringRef ModuleDocFilename,
openModuleFiles(AccessPathElem ModuleID, StringRef DirName,
StringRef ModuleFilename, StringRef ModuleDocFilename,
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
llvm::SmallVectorImpl<char> &Scratch) override;