diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-06-13 18:38:45 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-06-13 18:38:45 +0000 |
commit | dbda513550aaea9f4106455a3fc6b584bacc77f2 (patch) | |
tree | dbc64c924622c93696b46e9f0e3b332b9f8d7e11 | |
parent | 4c4efee6d3113f20b41efaeec08934332d2ea40e (diff) |
Put classes into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132924 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Basic/DiagnosticIDs.cpp | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 6d7e3204cb..346a769f70 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -199,17 +199,19 @@ unsigned DiagnosticIDs::getCategoryNumberForDiag(unsigned DiagID) { 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 @@ DiagnosticIDs::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass, 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; - - llvm::StringRef getName() const { return llvm::StringRef(NameStr, NameLen); } -}; +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); + } + }; +} #define GET_DIAG_ARRAYS #include "clang/Basic/DiagnosticGroups.inc" |