Skip to content

Commit 9268494

Browse files
[TableGen] Migrate away from PointerUnion::dyn_cast (NFC) (#125158)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect DiagsInPedantic and GroupsInPedantic to be nonnull.
1 parent c8ba57e commit 9268494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic,
359359

360360
// The diagnostic is not included in a group that is (transitively) in
361361
// -Wpedantic. Include it in -Wpedantic directly.
362-
if (auto *V = DiagsInPedantic.dyn_cast<RecordVec *>())
362+
if (auto *V = dyn_cast<RecordVec *>(DiagsInPedantic))
363363
V->push_back(R);
364364
else
365365
cast<RecordSet *>(DiagsInPedantic)->insert(R);
@@ -386,7 +386,7 @@ void InferPedantic::compute(VecOrSet DiagsInPedantic,
386386
if (Parents.size() > 0 && AllParentsInPedantic)
387387
continue;
388388

389-
if (auto *V = GroupsInPedantic.dyn_cast<RecordVec *>())
389+
if (auto *V = dyn_cast<RecordVec *>(GroupsInPedantic))
390390
V->push_back(Group);
391391
else
392392
cast<RecordSet *>(GroupsInPedantic)->insert(Group);

0 commit comments

Comments
 (0)