r221357 - Remove superceded warning warn_forgotten_module_header
Ben Langmuir
blangmuir at apple.com
Wed Nov 5 08:43:18 PST 2014
Author: benlangmuir
Date: Wed Nov 5 10:43:18 2014
New Revision: 221357
URL: http://llvm.org/viewvc/llvm-project?rev=221357&view=rev
Log:
Remove superceded warning warn_forgotten_module_header
This DefaultIgnore warning under -Wincomplete-module was firing on
any module map files that happened to be parsed (it's only supposed to
fire on headers), and it has been superceded by
-Wnon-modular-include-in-module anyway.
For compatibility, I rewired -Wincomplete-module to imply
-Wnon-modular-include-in-module.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
cfe/trunk/lib/Lex/PPLexerChange.cpp
cfe/trunk/test/Modules/incomplete-module.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=221357&r1=221356&r2=221357&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Wed Nov 5 10:43:18 2014
@@ -201,11 +201,13 @@ def IncompatiblePointerTypes
: DiagGroup<"incompatible-pointer-types",
[IncompatiblePointerTypesDiscardsQualifiers]>;
def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
-def IncompleteModule : DiagGroup<"incomplete-module", [IncompleteUmbrella]>;
def NonModularIncludeInFrameworkModule
: DiagGroup<"non-modular-include-in-framework-module">;
def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
[NonModularIncludeInFrameworkModule]>;
+def IncompleteModule : DiagGroup<"incomplete-module",
+ [IncompleteUmbrella, NonModularIncludeInModule]>;
+
def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=221357&r1=221356&r2=221357&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Wed Nov 5 10:43:18 2014
@@ -615,9 +615,6 @@ def warn_auto_module_import : Warning<
def warn_uncovered_module_header : Warning<
"umbrella header for module '%0' does not include header '%1'">,
InGroup<IncompleteUmbrella>;
-def warn_forgotten_module_header : Warning<
- "header '%0' is included in module '%1' but not listed in module map">,
- InGroup<IncompleteModule>, DefaultIgnore;
def err_expected_id_building_module : Error<
"expected a module name in '__building_module' expression">;
def error_use_of_private_header_outside_module : Error<
Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=221357&r1=221356&r2=221357&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Wed Nov 5 10:43:18 2014
@@ -499,34 +499,6 @@ bool Preprocessor::HandleEndOfFile(Token
}
}
}
-
- // Check whether there are any headers that were included, but not
- // mentioned at all in the module map. Such headers
- SourceLocation StartLoc
- = SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID());
- if (!getDiagnostics().isIgnored(diag::warn_forgotten_module_header,
- StartLoc)) {
- ModuleMap &ModMap = getHeaderSearchInfo().getModuleMap();
- for (unsigned I = 0, N = SourceMgr.local_sloc_entry_size(); I != N; ++I) {
- // We only care about file entries.
- const SrcMgr::SLocEntry &Entry = SourceMgr.getLocalSLocEntry(I);
- if (!Entry.isFile())
- continue;
-
- // Dig out the actual file.
- const FileEntry *File = Entry.getFile().getContentCache()->OrigEntry;
- if (!File)
- continue;
-
- // If it's not part of a module and not unknown, complain.
- if (!ModMap.findModuleForHeader(File, nullptr,
- /*IncludeTextualHeaders*/true) &&
- !ModMap.isHeaderInUnavailableModule(File)) {
- Diag(StartLoc, diag::warn_forgotten_module_header)
- << File->getName() << Mod->getFullModuleName();
- }
- }
- }
}
return true;
Modified: cfe/trunk/test/Modules/incomplete-module.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/incomplete-module.m?rev=221357&r1=221356&r2=221357&view=diff
==============================================================================
--- cfe/trunk/test/Modules/incomplete-module.m (original)
+++ cfe/trunk/test/Modules/incomplete-module.m Wed Nov 5 10:43:18 2014
@@ -2,4 +2,8 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules-cache-path=%t -Wincomplete-module -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s
-// CHECK: {{warning: header '.*incomplete_mod_missing.h' is included in module 'incomplete_mod' but not listed in module map}}
+// CHECK: warning: include of non-modular header inside module 'incomplete_mod'
+
+// RUN: rm -rf %t
+// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules-strict-decluse -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=DECLUSE
+// DECLUSE: error: module incomplete_mod does not depend on a module exporting {{'.*incomplete_mod_missing.h'}}
More information about the cfe-commits
mailing list