Index: include/clang/AST/StmtCXX.h =================================================================== --- include/clang/AST/StmtCXX.h +++ include/clang/AST/StmtCXX.h @@ -66,6 +66,7 @@ private llvm::TrailingObjects { friend TrailingObjects; + friend class ASTStmtReader; SourceLocation TryLoc; unsigned NumHandlers; @@ -90,22 +91,22 @@ SourceLocation getTryLoc() const { return TryLoc; } SourceLocation getEndLoc() const { - return getTrailingObjects()[NumHandlers]->getLocEnd(); + return getStmts()[NumHandlers]->getLocEnd(); } CompoundStmt *getTryBlock() { - return cast(getTrailingObjects()[0]); + return cast(getStmts()[0]); } const CompoundStmt *getTryBlock() const { - return cast(getTrailingObjects()[0]); + return cast(getStmts()[0]); } unsigned getNumHandlers() const { return NumHandlers; } CXXCatchStmt *getHandler(unsigned i) { - return cast(getTrailingObjects()[i + 1]); + return cast(getStmts()[i + 1]); } const CXXCatchStmt *getHandler(unsigned i) const { - return cast(getTrailingObjects()[i + 1]); + return cast(getStmts()[i + 1]); } static bool classof(const Stmt *T) { @@ -113,11 +114,8 @@ } child_range children() { - return child_range(getTrailingObjects(), - getTrailingObjects() + getNumHandlers() + 1); + return child_range(getStmts(), getStmts() + getNumHandlers() + 1); } - - friend class ASTStmtReader; }; /// CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for Index: lib/AST/StmtCXX.cpp =================================================================== --- lib/AST/StmtCXX.cpp +++ lib/AST/StmtCXX.cpp @@ -40,7 +40,7 @@ CXXTryStmt::CXXTryStmt(SourceLocation tryLoc, Stmt *tryBlock, ArrayRef handlers) : Stmt(CXXTryStmtClass), TryLoc(tryLoc), NumHandlers(handlers.size()) { - Stmt **Stmts = getTrailingObjects(); + Stmt **Stmts = getStmts(); Stmts[0] = tryBlock; std::copy(handlers.begin(), handlers.end(), Stmts + 1); }