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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189569 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp
index 71752bb..de3d469 100644
--- a/lib/Basic/DiagnosticIDs.cpp
+++ b/lib/Basic/DiagnosticIDs.cpp
@@ -505,17 +505,19 @@
#include "clang/Basic/DiagnosticGroups.inc"
#undef GET_DIAG_ARRAYS
-struct clang::WarningOption {
- uint16_t NameOffset;
- uint16_t Members;
- uint16_t SubGroups;
+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]);
- }
-};
+ // 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 @@
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 @@
Found->getName() != Group)
return true; // Option not found.
- getDiagnosticsInGroup(Found, Diags);
+ ::getDiagnosticsInGroup(Found, Diags);
return false;
}