Skip to content

Commit 4064087

Browse files
committed
replace getSpellingCount with hasSpelling
1 parent 98ca16b commit 4064087

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5210,12 +5210,12 @@ class SpellingList {
52105210
}
52115211
}
52125212

5213-
unsigned getSpellingCount() const {
5214-
unsigned Count = 0;
5215-
for (const auto &Item : Spellings)
5216-
if (Item.size() != 0)
5217-
++Count;
5218-
return Count;
5213+
bool hasSpelling() const {
5214+
for (size_t Kind = 0; Kind < NumSpellingKinds; ++Kind) {
5215+
if (Spellings[Kind].size() > 0)
5216+
return true;
5217+
}
5218+
return false;
52195219
}
52205220
};
52215221

@@ -5314,7 +5314,7 @@ static void WriteDocumentation(const RecordKeeper &Records,
53145314
OS << ".. _" << Label << ":\n\n";
53155315
OS << Doc.Heading << "\n" << std::string(Doc.Heading.length(), '-') << "\n";
53165316

5317-
if (Doc.SupportedSpellings.getSpellingCount() > 0) {
5317+
if (Doc.SupportedSpellings.hasSpelling()) {
53185318
// List what spelling syntaxes the attribute supports.
53195319
// Note: "#pragma clang attribute" is handled outside the spelling kinds
53205320
// loop so it must be last.

0 commit comments

Comments
 (0)