@@ -83,7 +83,7 @@ getCategoryFromDiagGroup(const Record *Group,
83
83
static std::string getDiagnosticCategory (const Record *R,
84
84
DiagGroupParentMap &DiagGroupParents) {
85
85
// If the diagnostic is in a group, and that group has a category, use it.
86
- if (DefInit *Group = dyn_cast<DefInit>(R->getValueInit (" Group" ))) {
86
+ if (const auto *Group = dyn_cast<DefInit>(R->getValueInit (" Group" ))) {
87
87
// Check the diagnostic's diag group for a category.
88
88
std::string CatName = getCategoryFromDiagGroup (Group->getDef (),
89
89
DiagGroupParents);
@@ -161,7 +161,7 @@ static void groupDiagnostics(ArrayRef<const Record *> Diags,
161
161
162
162
for (unsigned i = 0 , e = Diags.size (); i != e; ++i) {
163
163
const Record *R = Diags[i];
164
- DefInit *DI = dyn_cast<DefInit>(R->getValueInit (" Group" ));
164
+ const auto *DI = dyn_cast<DefInit>(R->getValueInit (" Group" ));
165
165
if (!DI)
166
166
continue ;
167
167
assert (R->getValueAsDef (" Class" )->getName () != " CLASS_NOTE" &&
@@ -359,7 +359,7 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic,
359
359
const Record *R = Diags[i];
360
360
if (isExtension (R) && isOffByDefault (R)) {
361
361
DiagsSet.insert (R);
362
- if (DefInit *Group = dyn_cast<DefInit>(R->getValueInit (" Group" ))) {
362
+ if (const auto *Group = dyn_cast<DefInit>(R->getValueInit (" Group" ))) {
363
363
const Record *GroupRec = Group->getDef ();
364
364
if (!isSubGroupOfGroup (GroupRec, " pedantic" )) {
365
365
markGroup (GroupRec);
@@ -378,13 +378,13 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic,
378
378
// Check if the group is implicitly in -Wpedantic. If so,
379
379
// the diagnostic should not be directly included in the -Wpedantic
380
380
// diagnostic group.
381
- if (DefInit *Group = dyn_cast<DefInit>(R->getValueInit (" Group" )))
381
+ if (const auto *Group = dyn_cast<DefInit>(R->getValueInit (" Group" )))
382
382
if (groupInPedantic (Group->getDef ()))
383
383
continue ;
384
384
385
385
// The diagnostic is not included in a group that is (transitively) in
386
386
// -Wpedantic. Include it in -Wpedantic directly.
387
- if (RecordVec *V = DiagsInPedantic.dyn_cast <RecordVec*>())
387
+ if (auto *V = DiagsInPedantic.dyn_cast <RecordVec *>())
388
388
V->push_back (R);
389
389
else {
390
390
DiagsInPedantic.get <RecordSet*>()->insert (R);
@@ -413,7 +413,7 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic,
413
413
if (Parents.size () > 0 && AllParentsInPedantic)
414
414
continue ;
415
415
416
- if (RecordVec *V = GroupsInPedantic.dyn_cast <RecordVec*>())
416
+ if (auto *V = GroupsInPedantic.dyn_cast <RecordVec *>())
417
417
V->push_back (Group);
418
418
else {
419
419
GroupsInPedantic.get <RecordSet*>()->insert (Group);
@@ -1443,7 +1443,7 @@ void clang::EmitClangDiagsDefs(const RecordKeeper &Records, raw_ostream &OS,
1443
1443
// Check if this is an error that is accidentally in a warning
1444
1444
// group.
1445
1445
if (isError (R)) {
1446
- if (DefInit *Group = dyn_cast<DefInit>(R.getValueInit (" Group" ))) {
1446
+ if (const auto *Group = dyn_cast<DefInit>(R.getValueInit (" Group" ))) {
1447
1447
const Record *GroupRec = Group->getDef ();
1448
1448
const std::string &GroupName =
1449
1449
std::string (GroupRec->getValueAsString (" GroupName" ));
@@ -1478,7 +1478,7 @@ void clang::EmitClangDiagsDefs(const RecordKeeper &Records, raw_ostream &OS,
1478
1478
1479
1479
// Warning group associated with the diagnostic. This is stored as an index
1480
1480
// into the alphabetically sorted warning group table.
1481
- if (DefInit *DI = dyn_cast<DefInit>(R.getValueInit (" Group" ))) {
1481
+ if (const auto *DI = dyn_cast<DefInit>(R.getValueInit (" Group" ))) {
1482
1482
std::map<std::string, GroupInfo>::iterator I = DiagsInGroup.find (
1483
1483
std::string (DI->getDef ()->getValueAsString (" GroupName" )));
1484
1484
assert (I != DiagsInGroup.end ());
0 commit comments