mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-05 04:38:37 +00:00
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. llvm-svn: 221357
This commit is contained in:
parent
626963187b
commit
6caebfda78
@ -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">;
|
||||
|
@ -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<
|
||||
|
@ -499,34 +499,6 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
@ -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'}}
|
||||
|
Loading…
Reference in New Issue
Block a user