From: Gabor Horvath Date: Tue, 14 Nov 2017 12:14:49 +0000 (+0000) Subject: Make DiagnosticIDs::getAllDiagnostics static. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0863d6bb71eba1d928dd621064b0172f6c10432e;p=clang Make DiagnosticIDs::getAllDiagnostics static. NFC. Patch by: Andras Leitereg! Differential Revision: https://reviews.llvm.org/D39372 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318150 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index a62d6af744..43183a120b 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -296,8 +296,8 @@ public: SmallVectorImpl &Diags) const; /// \brief Get the set of all diagnostic IDs. - void getAllDiagnostics(diag::Flavor Flavor, - SmallVectorImpl &Diags) const; + static void getAllDiagnostics(diag::Flavor Flavor, + SmallVectorImpl &Diags); /// \brief Get the diagnostic option with the closest edit distance to the /// given group name. diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 47f6a139b1..640b42c1ca 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -364,7 +364,7 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor, SourceLocation Loc) { // Get all the diagnostics. SmallVector AllDiags; - Diags->getAllDiagnostics(Flavor, AllDiags); + DiagnosticIDs::getAllDiagnostics(Flavor, AllDiags); // Set the mapping. for (diag::kind Diag : AllDiags) diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 4f59e550ba..5c53f35aa6 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -583,7 +583,7 @@ DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, } void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor, - SmallVectorImpl &Diags) const { + SmallVectorImpl &Diags) { for (unsigned i = 0; i != StaticDiagInfoSize; ++i) if (StaticDiagInfo[i].getFlavor() == Flavor) Diags.push_back(StaticDiagInfo[i].DiagID);