Add support for -Wimplicit-function-declaration, rdar://5907433
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50672 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index e7dacc4..96f6dde 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -475,6 +475,9 @@
WarnUndefMacros("Wundef",
llvm::cl::desc("Warn on use of undefined macros in #if's"));
+static llvm::cl::opt<bool>
+WarnImplicitFunctionDeclaration("Wimplicit-function-declaration"
+ "Warn about use of implicitly defined functions");
/// InitializeDiagnostics - Initialize the diagnostic object, based on the
/// current command line option settings.
@@ -498,6 +501,10 @@
if (!WarnUndefMacros)
Diags.setDiagnosticMapping(diag::warn_pp_undef_identifier,diag::MAP_IGNORE);
+ if (!WarnImplicitFunctionDeclaration)
+ Diags.setDiagnosticMapping(diag::warn_implicit_function_decl,
+ diag::MAP_IGNORE);
+
if (MSExtensions) // MS allows unnamed struct/union fields.
Diags.setDiagnosticMapping(diag::w_no_declarators, diag::MAP_IGNORE);