Revert "[serialization] Reject loading a module with the wrong case."

This reverts commit r22818, which caused
to fail.

Swift SVN r22822
This commit is contained in:
Dave Abrahams
2014-10-18 01:02:20 +00:00
parent 7fa402868d
commit 7eb173e487
8 changed files with 7 additions and 46 deletions

View File

@@ -504,8 +504,7 @@ ModuleFile::ModuleFile(
case CONTROL_BLOCK_ID: {
cursor.EnterSubBlock(CONTROL_BLOCK_ID);
ModuleStatus err;
std::tie(err, Name) = validateControlBlock(cursor, scratch);
ModuleStatus err = validateControlBlock(cursor, scratch).first;
if (err != ModuleStatus::Valid) {
error(err);
return;
@@ -747,11 +746,6 @@ bool ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc) {
assert(!FileContext && "already associated with an AST module");
FileContext = file;
if (file->getParentModule()->Name.str() != Name) {
error(ModuleStatus::NameMismatch);
return false;
}
ASTContext &ctx = getContext();
bool missingDependency = false;
for (auto &dependency : Dependencies) {
@@ -1097,7 +1091,8 @@ ModuleFile::collectLinkLibraries(Module::LinkLibraryCallback callback) const {
for (auto &lib : LinkLibraries)
callback(lib);
if (Bits.IsFramework)
callback(LinkLibrary(Name, LibraryKind::Framework));
callback(LinkLibrary(FileContext->getParentModule()->Name.str(),
LibraryKind::Framework));
}
void ModuleFile::getTopLevelDecls(SmallVectorImpl<Decl *> &results) {