add support for -Wundef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46274 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 295ddd7..02f8321 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -404,6 +404,11 @@
WarnNoFormatNonLiteral("Wno-format-nonliteral",
llvm::cl::desc("Do not warn about non-literal format strings."));
+static llvm::cl::opt<bool>
+WarnUndefMacros("Wundef",
+ llvm::cl::desc("Warn on use of undefined macros in #if's"));
+
+
/// InitializeDiagnostics - Initialize the diagnostic object, based on the
/// current command line option settings.
static void InitializeDiagnostics(Diagnostic &Diags) {
@@ -423,7 +428,8 @@
if (WarnNoFormatNonLiteral)
Diags.setDiagnosticMapping(diag::warn_printf_not_string_constant,
diag::MAP_IGNORE);
-
+ if (!WarnUndefMacros)
+ Diags.setDiagnosticMapping(diag::warn_pp_undef_identifier,diag::MAP_IGNORE);
}
//===----------------------------------------------------------------------===//