Re-apply "[serialization] Reject loading a module with the wrong case."

This included a test that failed on case-sensitive filesystems. Test fixed.

(Aside: Why not just have this fail with "no such module"? Why use a different
error? Because even if "import FOO" picks up a module named 'Foo', there may
actually be a module named 'FOO' on the system (in another folder), and we
should be able to find that. Fixing that is tracked by rdar://problem/18691936.)

rdar://problem/15632996 (again)

Swift SVN r22856
This commit is contained in:
Jordan Rose
2014-10-21 00:30:09 +00:00
parent c3a4ae056c
commit 9d9f9ef150
8 changed files with 46 additions and 7 deletions

View File

@@ -64,6 +64,9 @@ class ModuleFile : public LazyMemberLoader {
llvm::BitstreamCursor SILCursor;
llvm::BitstreamCursor SILIndexCursor;
/// The name of the module.
StringRef Name;
/// The data blob containing all of the module's identifiers.
StringRef IdentifierData;
@@ -478,6 +481,11 @@ public:
return ModuleInputBuffer->getBufferIdentifier();
}
/// Returns the module name as stored in the serialized data.
StringRef getModuleName() const {
return Name;
}
/// AST-verify imported decls.
///
/// Has no effect in NDEBUG builds.