]> granicus.if.org Git - clang/commitdiff
Make getDiagnosticsInGroup helper method a static function in the cpp file and move...
authorCraig Topper <craig.topper@gmail.com>
Thu, 29 Aug 2013 06:06:18 +0000 (06:06 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 29 Aug 2013 06:06:18 +0000 (06:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189569 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticIDs.h
lib/Basic/DiagnosticIDs.cpp

index 25e5dfd0e8fc2f22c8de73a28351f56ba55e8d28..237b826f988311bc526d02b7c5a4730bae82a51f 100644 (file)
@@ -22,7 +22,6 @@
 namespace clang {
   class DiagnosticsEngine;
   class SourceLocation;
-  struct WarningOption;
 
   // Import the diagnostic enums themselves.
   namespace diag {
@@ -240,12 +239,6 @@ public:
   static StringRef getNearestWarningOption(StringRef Group);
 
 private:
-  /// \brief Get the set of all diagnostic IDs in the given group.
-  ///
-  /// \param[out] Diags - On return, the diagnostics in the group.
-  void getDiagnosticsInGroup(const WarningOption *Group,
-                             SmallVectorImpl<diag::kind> &Diags) const;
   /// \brief Classify the specified diagnostic ID into a Level, consumable by
   /// the DiagnosticClient.
   /// 
index 71752bb38f6dd85bf498c9447163b6abfc705d31..de3d469cad8489bbc24aee60996f6f130cba9684 100644 (file)
@@ -505,17 +505,19 @@ DiagnosticIDs::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass,
 #include "clang/Basic/DiagnosticGroups.inc"
 #undef GET_DIAG_ARRAYS
 
-struct clang::WarningOption {
-  uint16_t NameOffset;
-  uint16_t Members;
-  uint16_t SubGroups;
-
-  // String is stored with a pascal-style length byte.
-  StringRef getName() const {
-    return StringRef(DiagGroupNames + NameOffset + 1,
-                     DiagGroupNames[NameOffset]);
-  }
-};
+namespace {
+  struct WarningOption {
+    uint16_t NameOffset;
+    uint16_t Members;
+    uint16_t SubGroups;
+
+    // String is stored with a pascal-style length byte.
+    StringRef getName() const {
+      return StringRef(DiagGroupNames + NameOffset + 1,
+                       DiagGroupNames[NameOffset]);
+    }
+  };
+}
 
 // Second the table of options, sorted by name for fast binary lookup.
 static const WarningOption OptionTable[] = {
@@ -538,9 +540,8 @@ StringRef DiagnosticIDs::getWarningOptionForDiag(unsigned DiagID) {
   return StringRef();
 }
 
-void DiagnosticIDs::getDiagnosticsInGroup(
-    const WarningOption *Group,
-    SmallVectorImpl<diag::kind> &Diags) const {
+static void getDiagnosticsInGroup(const WarningOption *Group,
+                                  SmallVectorImpl<diag::kind> &Diags) {
   // Add the members of the option diagnostic set.
   const int16_t *Member = DiagArrays + Group->Members;
   for (; *Member != -1; ++Member)
@@ -562,7 +563,7 @@ bool DiagnosticIDs::getDiagnosticsInGroup(
       Found->getName() != Group)
     return true; // Option not found.
 
-  getDiagnosticsInGroup(Found, Diags);
+  ::getDiagnosticsInGroup(Found, Diags);
   return false;
 }