summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.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/lib/Basic/Diagnostic.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/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index f9e1d2bda3e..0f8f314f15c 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -113,6 +113,7 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) {
WarningsAsErrors = false;
WarnOnExtensions = false;
ErrorOnExtensions = false;
+ SuppressSystemWarnings = false;
// Clear all mappings, setting them to MAP_DEFAULT.
memset(DiagMappings, 0, sizeof(DiagMappings));
@@ -224,7 +225,8 @@ void Diagnostic::Report(DiagnosticClient* C,
// have to check on the original DiagID here, because we also want to
// ignore extensions and warnings in -Werror and -pedantic-errors modes,
// which *map* warnings/extensions to errors.
- if (DiagID < diag::NUM_BUILTIN_DIAGNOSTICS &&
+ if (SuppressSystemWarnings &&
+ DiagID < diag::NUM_BUILTIN_DIAGNOSTICS &&
getBuiltinDiagClass(DiagID) != ERROR &&
Loc.isValid() && Loc.isFileID() && Loc.isInSystemHeader())
return;
OpenPOWER on IntegriCloud