summaryrefslogtreecommitdiffstats
path: root/clang/Driver/TextDiagnostics.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-03 09:00:04 +0000
committerChris Lattner <sabre@nondot.org>2008-02-03 09:00:04 +0000
commit3ac9699c44da272bd60c01a534aa10cc78e898ac (patch)
treec0c2b63e0f16ced27e32b7cc5cdc9400e3fd9082 /clang/Driver/TextDiagnostics.cpp
parent15e4ad81c3331c5355446642b060259ff51e5d36 (diff)
downloadbcm5719-llvm-3ac9699c44da272bd60c01a534aa10cc78e898ac.tar.gz
bcm5719-llvm-3ac9699c44da272bd60c01a534aa10cc78e898ac.zip
Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
*mapped* onto errors. llvm-svn: 46686
Diffstat (limited to 'clang/Driver/TextDiagnostics.cpp')
-rw-r--r--clang/Driver/TextDiagnostics.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/clang/Driver/TextDiagnostics.cpp b/clang/Driver/TextDiagnostics.cpp
index 01484e0fc49..7a78e947833 100644
--- a/clang/Driver/TextDiagnostics.cpp
+++ b/clang/Driver/TextDiagnostics.cpp
@@ -39,19 +39,14 @@ std::string TextDiagnostics::FormatDiagnostic(Diagnostic &Diags,
return Msg;
}
-bool TextDiagnostics::IgnoreDiagnostic(Diagnostic::Level Level,
- FullSourceLoc Pos) {
- if (Pos.isValid()) {
- // If this is a warning or note, and if it a system header, suppress the
- // diagnostic.
- if (Level == Diagnostic::Warning || Level == Diagnostic::Note) {
- if (const FileEntry *F = Pos.getFileEntryForLoc()) {
- DirectoryLookup::DirType DirInfo = TheHeaderSearch->getFileDirFlavor(F);
- if (DirInfo == DirectoryLookup::SystemHeaderDir ||
- DirInfo == DirectoryLookup::ExternCSystemHeaderDir)
- return true;
- }
- }
+bool TextDiagnostics::isInSystemHeader(FullSourceLoc Pos) const {
+ if (!Pos.isValid()) return false;
+
+ if (const FileEntry *F = Pos.getFileEntryForLoc()) {
+ DirectoryLookup::DirType DirInfo = TheHeaderSearch->getFileDirFlavor(F);
+ if (DirInfo == DirectoryLookup::SystemHeaderDir ||
+ DirInfo == DirectoryLookup::ExternCSystemHeaderDir)
+ return true;
}
return false;
OpenPOWER on IntegriCloud