Skip to content

Commit f4b938b

Browse files
[TableGen] Use range-based for loops (NFC) (#146626)
1 parent b809d5e commit f4b938b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4904,9 +4904,8 @@ void EmitClangAttrParsedAttrImpl(const RecordKeeper &Records, raw_ostream &OS) {
49044904
}
49054905

49064906
OS << "static const ParsedAttrInfo *AttrInfoMap[] = {\n";
4907-
for (auto I = Attrs.begin(), E = Attrs.end(); I != E; ++I) {
4908-
OS << "&ParsedAttrInfo" << I->first << "::Instance,\n";
4909-
}
4907+
for (const auto &Attr : Attrs)
4908+
OS << "&ParsedAttrInfo" << Attr.first << "::Instance,\n";
49104909
OS << "};\n\n";
49114910

49124911
// Generate function for handling attributes with delayed arguments
@@ -5261,10 +5260,9 @@ GetAttributeHeadingAndSpellings(const Record &Documentation,
52615260
Heading = Spellings.begin()->name();
52625261
else {
52635262
std::set<std::string> Uniques;
5264-
for (auto I = Spellings.begin(), E = Spellings.end();
5265-
I != E; ++I) {
5263+
for (const FlattenedSpelling &FS : Spellings) {
52665264
std::string Spelling =
5267-
NormalizeNameForSpellingComparison(I->name()).str();
5265+
NormalizeNameForSpellingComparison(FS.name()).str();
52685266
Uniques.insert(Spelling);
52695267
}
52705268
// If the semantic map has only one spelling, that is sufficient for our

0 commit comments

Comments
 (0)