forked from OSchip/llvm-project
Introduce an opt-in warning when a module is being implicitly built
from sources. llvm-svn: 140746
This commit is contained in:
parent
d299dccf91
commit
44e688d46a
|
@ -63,6 +63,8 @@ def err_module_not_found : Error<"module '%0' not found">, DefaultFatal;
|
|||
def err_module_not_built : Error<"could not build module '%0'">, DefaultFatal;
|
||||
def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
|
||||
DefaultFatal;
|
||||
def warn_module_build : Warning<"building module '%0' from source">,
|
||||
InGroup<ModuleBuild>, DefaultIgnore;
|
||||
|
||||
// Sema && Lex
|
||||
def ext_longlong : Extension<
|
||||
|
|
|
@ -85,6 +85,7 @@ def : DiagGroup<"newline-eof">;
|
|||
def LongLong : DiagGroup<"long-long">;
|
||||
def MismatchedTags : DiagGroup<"mismatched-tags">;
|
||||
def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
|
||||
def ModuleBuild : DiagGroup<"module-build">;
|
||||
def NullDereference : DiagGroup<"null-dereference">;
|
||||
def InitializerOverrides : DiagGroup<"initializer-overrides">;
|
||||
def NonNull : DiagGroup<"nonnull">;
|
||||
|
|
|
@ -752,6 +752,8 @@ ModuleKey CompilerInstance::loadModule(SourceLocation ImportLoc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
getDiagnostics().Report(ModuleNameLoc, diag::warn_module_build)
|
||||
<< ModuleName.getName();
|
||||
BuildingModule = true;
|
||||
compileModule(*this, ModuleName.getName(), ModuleFileName, UmbrellaHeader);
|
||||
ModuleFile = PP->getHeaderSearchInfo().lookupModule(ModuleName.getName());
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
|
||||
|
||||
__import_module__ Module; // expected-warning{{building module 'Module' from source}}
|
||||
|
Loading…
Reference in New Issue