From 6f3e4c20d4277424a2181c678b85fa90cd8138c7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 17 Jul 2025 08:07:26 -0700 Subject: [PATCH 1/2] [AST] Remove an unnecessary cast (NFC) getFinallyStmt() already returns ObjCAtFinallyStmt *. --- clang/lib/AST/StmtPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index be02bdde38a3d..5d4c8370dfb5f 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -610,7 +610,7 @@ void StmtPrinter::VisitObjCAtTryStmt(ObjCAtTryStmt *Node) { } } - if (auto *FS = static_cast(Node->getFinallyStmt())) { + if (auto *FS = Node->getFinallyStmt()) { Indent() << "@finally"; if (auto *CS = dyn_cast(FS->getFinallyBody())) { PrintRawCompoundStmt(CS); From 3ad8b6f246796fab721ea748c260ec4dbf1cad84 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 17 Jul 2025 12:50:54 -0700 Subject: [PATCH 2/2] Address a comment. --- clang/lib/AST/StmtPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 5d4c8370dfb5f..6ba5ec89964a9 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -610,7 +610,7 @@ void StmtPrinter::VisitObjCAtTryStmt(ObjCAtTryStmt *Node) { } } - if (auto *FS = Node->getFinallyStmt()) { + if (ObjCAtFinallyStmt *FS = Node->getFinallyStmt()) { Indent() << "@finally"; if (auto *CS = dyn_cast(FS->getFinallyBody())) { PrintRawCompoundStmt(CS);