diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-27 06:15:43 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-27 06:15:43 +0000 |
commit | 9ffada97ce7bf4def03a8158064b6c8df274f95a (patch) | |
tree | 2bcb690d78a892fb33fd189c6713195c39df1cc4 /clang/lib/Basic | |
parent | 0b5ec2d19970b4889886bfb7c0ac5542083cb74e (diff) | |
download | bcm5719-llvm-9ffada97ce7bf4def03a8158064b6c8df274f95a.tar.gz bcm5719-llvm-9ffada97ce7bf4def03a8158064b6c8df274f95a.zip |
Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.
We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.
llvm-svn: 149121
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 14 | ||||
-rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 6 |
2 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 67ea056417f..eab79d6442d 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -295,6 +295,20 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group, return false; } +bool DiagnosticsEngine::setMappingToAllDiagnostics(diag::Mapping Map, + SourceLocation Loc) { + // Get all the diagnostics. + llvm::SmallVector<diag::kind, 64> AllDiags; + Diags->getAllDiagnostics(AllDiags); + + // Set the mapping. + for (unsigned i = 0, e = AllDiags.size(); i != e; ++i) + if (Diags->isBuiltinWarningOrExtension(AllDiags[i])) + setDiagnosticMapping(AllDiags[i], Map, Loc); + + return false; +} + void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) { assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index b3c4d033c28..9f09f72e868 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -682,6 +682,12 @@ bool DiagnosticIDs::getDiagnosticsInGroup( return false; } +void DiagnosticIDs::getAllDiagnostics( + llvm::SmallVectorImpl<diag::kind> &Diags) const { + for (unsigned i = 0; i != StaticDiagInfoSize; ++i) + Diags.push_back(StaticDiagInfo[i].DiagID); +} + StringRef DiagnosticIDs::getNearestWarningOption(StringRef Group) { StringRef Best; unsigned BestDistance = Group.size() + 1; // Sanity threshold. |