diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-23 17:19:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-23 17:19:46 +0000 |
| commit | 7238225c285180cd3282fb52064c591083eb58f3 (patch) | |
| tree | 1b0bb0ccd2af4664e057c8a72d1c9d92c2328788 /clang/Driver/clang.cpp | |
| parent | 54e42318c027c7ab70af0734bf83d1b7b28ac211 (diff) | |
| download | bcm5719-llvm-7238225c285180cd3282fb52064c591083eb58f3.tar.gz bcm5719-llvm-7238225c285180cd3282fb52064c591083eb58f3.zip | |
add support for -Wundef.
llvm-svn: 46274
Diffstat (limited to 'clang/Driver/clang.cpp')
| -rw-r--r-- | clang/Driver/clang.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 295ddd7d52c..02f8321b689 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -404,6 +404,11 @@ static llvm::cl::opt<bool> 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 @@ static void InitializeDiagnostics(Diagnostic &Diags) { 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); } //===----------------------------------------------------------------------===// |

