Skip to content

Commit

Permalink
[Clang][TableGen] Change ClangDiagnosticEmitter to use const Record * (
Browse files Browse the repository at this point in the history
  • Loading branch information
jurahul authored Oct 1, 2024
1 parent 017c2ab commit 52e7c69
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class DiagGroupParentMap {
ArrayRef<const Record *> DiagGroups =
Records.getAllDerivedDefinitions("DiagGroup");
for (unsigned i = 0, e = DiagGroups.size(); i != e; ++i) {
std::vector<Record*> SubGroups =
DiagGroups[i]->getValueAsListOfDefs("SubGroups");
std::vector<const Record *> SubGroups =
DiagGroups[i]->getValueAsListOfConstDefs("SubGroups");
for (unsigned j = 0, e = SubGroups.size(); j != e; ++j)
Mapping[SubGroups[j]].push_back(DiagGroups[i]);
}
Expand Down Expand Up @@ -180,10 +180,8 @@ static void groupDiagnostics(ArrayRef<const Record *> Diags,
GI.GroupName = Group->getName();
GI.Defs.push_back(Group);

std::vector<Record*> SubGroups = Group->getValueAsListOfDefs("SubGroups");
for (unsigned j = 0, e = SubGroups.size(); j != e; ++j)
GI.SubGroups.push_back(
std::string(SubGroups[j]->getValueAsString("GroupName")));
for (const Record *SubGroup : Group->getValueAsListOfDefs("SubGroups"))
GI.SubGroups.push_back(SubGroup->getValueAsString("GroupName").str());
}

// Assign unique ID numbers to the groups.
Expand Down

0 comments on commit 52e7c69

Please sign in to comment.