[cfe-commits] r132924 - /cfe/trunk/lib/Basic/DiagnosticIDs.cpp

Benjamin Kramer benny.kra at googlemail.com
Mon Jun 13 11:38:45 PDT 2011


Author: d0k
Date: Mon Jun 13 13:38:45 2011
New Revision: 132924

URL: http://llvm.org/viewvc/llvm-project?rev=132924&view=rev
Log:
Put classes into anonymous namespaces.

Modified:
    cfe/trunk/lib/Basic/DiagnosticIDs.cpp

Modified: cfe/trunk/lib/Basic/DiagnosticIDs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?rev=132924&r1=132923&r2=132924&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/DiagnosticIDs.cpp (original)
+++ cfe/trunk/lib/Basic/DiagnosticIDs.cpp Mon Jun 13 13:38:45 2011
@@ -199,17 +199,19 @@
   return 0;
 }
 
-// The diagnostic category names.
-struct StaticDiagCategoryRec {
-  const char *NameStr;
-  uint8_t NameLen;
+namespace {
+  // The diagnostic category names.
+  struct StaticDiagCategoryRec {
+    const char *NameStr;
+    uint8_t NameLen;
 
-  llvm::StringRef getName() const {
-    return llvm::StringRef(NameStr, NameLen);
-  }
-};
+    llvm::StringRef getName() const {
+      return llvm::StringRef(NameStr, NameLen);
+    }
+  };
+}
 
-static StaticDiagCategoryRec CategoryNameTable[] = {
+static const StaticDiagCategoryRec CategoryNameTable[] = {
 #define GET_CATEGORY_TABLE
 #define CATEGORY(X) { X, STR_SIZE(X, uint8_t) },
 #include "clang/Basic/DiagnosticGroups.inc"
@@ -543,17 +545,21 @@
   return Result;
 }
 
-struct WarningOption {
-  // Be safe with the size of 'NameLen' because we don't statically check if the
-  // size will fit in the field; the struct size won't decrease with a shorter
-  // type anyway.
-  size_t NameLen;
-  const char *NameStr;
-  const short *Members;
-  const short *SubGroups;
+namespace {
+  struct WarningOption {
+    // Be safe with the size of 'NameLen' because we don't statically check if
+    // the size will fit in the field; the struct size won't decrease with a
+    // shorter type anyway.
+    size_t NameLen;
+    const char *NameStr;
+    const short *Members;
+    const short *SubGroups;
 
-  llvm::StringRef getName() const { return llvm::StringRef(NameStr, NameLen); }
-};
+    llvm::StringRef getName() const {
+      return llvm::StringRef(NameStr, NameLen);
+    }
+  };
+}
 
 #define GET_DIAG_ARRAYS
 #include "clang/Basic/DiagnosticGroups.inc"





More information about the cfe-commits mailing list