Skip to content

Commit e622468

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124074)
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 CO to be nonnull.
1 parent fa29929 commit e622468

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/JSONNodeDumper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,9 +1537,9 @@ void JSONNodeDumper::VisitExprWithCleanups(const ExprWithCleanups *EWC) {
15371537
if (EWC->getNumObjects()) {
15381538
JOS.attributeArray("cleanups", [this, EWC] {
15391539
for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1540-
if (auto *BD = CO.dyn_cast<BlockDecl *>()) {
1540+
if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
15411541
JOS.value(createBareDeclRef(BD));
1542-
} else if (auto *CLE = CO.dyn_cast<CompoundLiteralExpr *>()) {
1542+
} else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
15431543
llvm::json::Object Obj;
15441544
Obj["id"] = createPointerRepresentation(CLE);
15451545
Obj["kind"] = CLE->getStmtClassName();

0 commit comments

Comments
 (0)