Author: Rahul Joshi Date: 2025-06-07T09:36:51-07:00 New Revision: de256ac8fb33ef1d5f38be278a8a81e0cc5236eb
URL: https://github.com/llvm/llvm-project/commit/de256ac8fb33ef1d5f38be278a8a81e0cc5236eb DIFF: https://github.com/llvm/llvm-project/commit/de256ac8fb33ef1d5f38be278a8a81e0cc5236eb.diff LOG: [NFC][Clang] Adopt simplified `getTrailingObjects` in StmtObjC (#143256) Added: Modified: clang/include/clang/AST/StmtObjC.h Removed: ################################################################################ diff --git a/clang/include/clang/AST/StmtObjC.h b/clang/include/clang/AST/StmtObjC.h index 03bc61f54cdf5..af95d65fa2a3c 100644 --- a/clang/include/clang/AST/StmtObjC.h +++ b/clang/include/clang/AST/StmtObjC.h @@ -166,7 +166,8 @@ class ObjCAtTryStmt final : public Stmt, private llvm::TrailingObjects<ObjCAtTryStmt, Stmt *> { friend TrailingObjects; - size_t numTrailingObjects(OverloadToken<Stmt *>) const { + + size_t numTrailingStatements() const { return 1 + NumCatchStmts + HasFinally; } @@ -185,8 +186,8 @@ class ObjCAtTryStmt final /// The order of the statements in memory follows the order in the source, /// with the \@try body first, followed by the \@catch statements (if any) /// and, finally, the \@finally (if it exists). - Stmt **getStmts() { return getTrailingObjects<Stmt *>(); } - Stmt *const *getStmts() const { return getTrailingObjects<Stmt *>(); } + Stmt **getStmts() { return getTrailingObjects(); } + Stmt *const *getStmts() const { return getTrailingObjects(); } ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, @@ -262,8 +263,7 @@ class ObjCAtTryStmt final } child_range children() { - return child_range( - getStmts(), getStmts() + numTrailingObjects(OverloadToken<Stmt *>())); + return child_range(getStmts(), getStmts() + numTrailingStatements()); } const_child_range children() const { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits