瀏覽代碼

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
Gabor Horvath 7 年之前
父節點
當前提交
0863d6bb71
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      include/clang/Basic/DiagnosticIDs.h
  2. 1 1
      lib/Basic/Diagnostic.cpp
  3. 1 1
      lib/Basic/DiagnosticIDs.cpp

+ 2 - 2
include/clang/Basic/DiagnosticIDs.h

@@ -296,8 +296,8 @@ public:
                              SmallVectorImpl<diag::kind> &Diags) const;
                              SmallVectorImpl<diag::kind> &Diags) const;
 
 
   /// \brief Get the set of all diagnostic IDs.
   /// \brief Get the set of all diagnostic IDs.
-  void getAllDiagnostics(diag::Flavor Flavor,
-                         SmallVectorImpl<diag::kind> &Diags) const;
+  static void getAllDiagnostics(diag::Flavor Flavor,
+                                SmallVectorImpl<diag::kind> &Diags);
 
 
   /// \brief Get the diagnostic option with the closest edit distance to the
   /// \brief Get the diagnostic option with the closest edit distance to the
   /// given group name.
   /// given group name.

+ 1 - 1
lib/Basic/Diagnostic.cpp

@@ -364,7 +364,7 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
                                           SourceLocation Loc) {
                                           SourceLocation Loc) {
   // Get all the diagnostics.
   // Get all the diagnostics.
   SmallVector<diag::kind, 64> AllDiags;
   SmallVector<diag::kind, 64> AllDiags;
-  Diags->getAllDiagnostics(Flavor, AllDiags);
+  DiagnosticIDs::getAllDiagnostics(Flavor, AllDiags);
 
 
   // Set the mapping.
   // Set the mapping.
   for (diag::kind Diag : AllDiags)
   for (diag::kind Diag : AllDiags)

+ 1 - 1
lib/Basic/DiagnosticIDs.cpp

@@ -583,7 +583,7 @@ DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
 }
 }
 
 
 void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor,
 void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor,
-                                     SmallVectorImpl<diag::kind> &Diags) const {
+                                      SmallVectorImpl<diag::kind> &Diags) {
   for (unsigned i = 0; i != StaticDiagInfoSize; ++i)
   for (unsigned i = 0; i != StaticDiagInfoSize; ++i)
     if (StaticDiagInfo[i].getFlavor() == Flavor)
     if (StaticDiagInfo[i].getFlavor() == Flavor)
       Diags.push_back(StaticDiagInfo[i].DiagID);
       Diags.push_back(StaticDiagInfo[i].DiagID);