Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clang/include/clang/AST/StmtObjC.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
Loading