summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/DiagnosticIDs.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-08-29 06:06:18 +0000
committerCraig Topper <craig.topper@gmail.com>2013-08-29 06:06:18 +0000
commitb78e9d9b2f1ac8539890a78e696d4332ecf7be1b (patch)
tree72694e8e71738e7a3604aee3eb6bd8917dc1a530 /clang/lib/Basic/DiagnosticIDs.cpp
parentda7cf8ab2b22ec96c8d334d65daad1deba872381 (diff)
downloadbcm5719-llvm-b78e9d9b2f1ac8539890a78e696d4332ecf7be1b.tar.gz
bcm5719-llvm-b78e9d9b2f1ac8539890a78e696d4332ecf7be1b.zip
Make getDiagnosticsInGroup helper method a static function in the cpp file and move the WarningOption struct into an anonymous namespace instead of clang namespace since it no longer needs to be forward declared in the header.
llvm-svn: 189569
Diffstat (limited to 'clang/lib/Basic/DiagnosticIDs.cpp')
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 71752bb38f6..de3d469cad8 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -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;
}
OpenPOWER on IntegriCloud