diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td index f28f9983d0e0141a54e13195dbbff5ecd141bbd9..b0d352fc69348947806c0545344be9de18c28a11 100644 --- a/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/include/clang/Basic/DiagnosticSerializationKinds.td @@ -66,9 +66,6 @@ def err_imported_module_relocated : Error< def err_module_different_modmap : Error< "module '%0' %select{uses|does not use}1 additional module map '%2'" "%select{| not}1 used when the module was built">; -def err_module_system_change : Error< - "module '%0' %select{is|is not}1 a 'system' module, but " - "%select{was not|was}1 when the module was built">; def warn_module_conflict : Warning< "module '%0' conflicts with already-imported module '%1': %2">, InGroup<ModuleConflict>; diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 1fed331ff2df24074aaeff1d85873919b65d543f..28e7da37fd59e1741078911b11d0bf6a40ebf394 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -496,15 +496,11 @@ public: /// \param ModuleName The module whose module file name will be returned. /// /// \param ModuleMapPath A path that when combined with \c ModuleName - /// and \p IsSystem uniquely identifies this module. See Module::ModuleMap. - /// - /// \param IsSystem Whether the \p ModuleName is a system module, which may - /// depend on how header search paths were specified. + /// uniquely identifies this module. See Module::ModuleMap. /// /// \returns The name of the module file that corresponds to this module, /// or an empty string if this module does not correspond to any module file. - std::string getModuleFileName(StringRef ModuleName, StringRef ModuleMapPath, - bool IsSystem); + std::string getModuleFileName(StringRef ModuleName, StringRef ModuleMapPath); /// \brief Lookup a module Search for a module with the given name. /// diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index c8673e50a058661b76d4c0db12ee8be7eb0de13b..a55a3257851f8e2b81c4fca8c2d6e864b60a7463 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -366,7 +366,7 @@ bool GenerateModuleAction::ComputeASTConsumerArguments(CompilerInstance &CI, HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo(); CI.getFrontendOpts().OutputFile = HS.getModuleFileName(CI.getLangOpts().CurrentModule, - ModuleMapForUniquing->getName(), IsSystem); + ModuleMapForUniquing->getName()); } // We use createOutputFile here because this is exposed via libclang, and we diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index f76d851ac6c9575575e6d0c3cdd22054a8a1d3a5..d6b255fb014e05ab285ed3e953b57138292c1162 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/lib/Lex/HeaderSearch.cpp @@ -115,13 +115,11 @@ const HeaderMap *HeaderSearch::CreateHeaderMap(const FileEntry *FE) { std::string HeaderSearch::getModuleFileName(Module *Module) { const FileEntry *ModuleMap = getModuleMap().getModuleMapFileForUniquing(Module); - return getModuleFileName(Module->Name, ModuleMap->getName(), - Module->IsSystem); + return getModuleFileName(Module->Name, ModuleMap->getName()); } std::string HeaderSearch::getModuleFileName(StringRef ModuleName, - StringRef ModuleMapPath, - bool IsSystem) { + StringRef ModuleMapPath) { // If we don't have a module cache path, we can't do anything. if (ModuleCachePath.empty()) return std::string(); @@ -149,10 +147,6 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName, llvm::hash_code Hash = llvm::hash_combine(DirName.lower(), FileName.lower()); - // Hash the IsSystem bit, since changing search paths can change whether a - // module is considered 'system' or not. - Hash = llvm::hash_combine(Hash, IsSystem); - SmallString<128> HashStr; llvm::APInt(64, size_t(Hash)).toStringUnsigned(HashStr, /*Radix*/36); llvm::sys::path::append(Result, ModuleName + "-" + HashStr.str() + ".pcm"); diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 7774b7b1c6e74024d9928bd9ecb272bfcb02e0f6..bb6a450222d3163a4737bbb7609a613f7c8b5e7d 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -3468,13 +3468,6 @@ ASTReader::ReadModuleMapFileBlock(RecordData &Record, ModuleFile &F, << F.ModuleName << /*not new*/1 << ModMap->getName(); return OutOfDate; } - - // Check whether the 'IsSystem' bit changed. - if (M->IsSystem != static_cast<bool>(Record[Idx])) { - if ((ClientLoadCapabilities & ARR_OutOfDate) == 0) - Diag(diag::err_module_system_change) << F.ModuleName << M->IsSystem; - return OutOfDate; - } } if (Listener) diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index c0ce5f8e5ca7715aa0a06ac3a3331251ff617b06..07d5d29e44b0d41df644ea3e70a8c3a66a4ed6fc 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1216,7 +1216,6 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, Record.push_back(0); } - Record.push_back(WritingModule->IsSystem); Stream.EmitRecord(MODULE_MAP_FILE, Record); } diff --git a/test/Modules/modules-with-same-name.m b/test/Modules/modules-with-same-name.m index 3c5f88b18ac3a7f48df8db856f5b26f98b8cb8ba..d362f756a60a885733b0ae577938bf7c9e16ce81 100644 --- a/test/Modules/modules-with-same-name.m +++ b/test/Modules/modules-with-same-name.m @@ -21,14 +21,6 @@ // Confirm that we still have three pcm files, since DependsOnA will be rebuilt // RUN: find %t -name "*.pcm" | count 3 -// DependsOnA, using A from path 2, as a system path -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodules-ignore-macro=EXPECTED_PATH -fmodules-ignore-macro=DIRECT -fsyntax-only %s -I %S/Inputs/modules-with-same-name/DependsOnA -isystem %S/Inputs/modules-with-same-name/path2/A -DEXPECTED_PATH=2 -Rmodule-build 2> %t.log -// Confirm that we built a new module for A -// RUN: FileCheck %s < %t.log -// CHECK: building module 'DependsOnA' -// CHECK: building module 'A' -// RUN: find %t -name "*.pcm" | count 4 - #ifdef DIRECT @import A; #else