summaryrefslogtreecommitdiffstats
path: root/clang/Driver/clang.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-12 18:10:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-12 18:10:20 +0000
commit84b70f7f0f6d4c07695177620743d51075592586 (patch)
tree1d3a3a152c7783c0d5b6e4c141771327d3d2c4f8 /clang/Driver/clang.cpp
parentec270fb6406316c7afa6e3a1684e21b1bce4b61f (diff)
downloadbcm5719-llvm-84b70f7f0f6d4c07695177620743d51075592586.tar.gz
bcm5719-llvm-84b70f7f0f6d4c07695177620743d51075592586.zip
Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins. - Currently also enables the behavior that allows silent redefinition of types in system headers. Conceptually these are separate but I didn't feel it was worth two options (or changing LangOptions). llvm-svn: 56163
Diffstat (limited to 'clang/Driver/clang.cpp')
-rw-r--r--clang/Driver/clang.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp
index ef12eaf2c26..0efe56a3507 100644
--- a/clang/Driver/clang.cpp
+++ b/clang/Driver/clang.cpp
@@ -520,6 +520,11 @@ ErrorOnExtensions("pedantic-errors",
llvm::cl::desc("Issue an error on uses of GCC extensions"));
static llvm::cl::opt<bool>
+SuppressSystemWarnings("suppress-system-warnings",
+ llvm::cl::desc("Issue an error on uses of GCC extensions"),
+ llvm::cl::init(true));
+
+static llvm::cl::opt<bool>
WarnUnusedMacros("Wunused_macros",
llvm::cl::desc("Warn for unused macros in the main translation unit"));
@@ -547,6 +552,9 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
Diags.setWarnOnExtensions(WarnOnExtensions);
Diags.setErrorOnExtensions(ErrorOnExtensions);
+ // Suppress warnings in system headers unless requested not to.
+ Diags.setSuppressSystemWarnings(SuppressSystemWarnings);
+
// Silence the "macro is not used" warning unless requested.
if (!WarnUnusedMacros)
Diags.setDiagnosticMapping(diag::pp_macro_not_used, diag::MAP_IGNORE);
OpenPOWER on IntegriCloud