From: Erik Verbruggen Date: Thu, 27 Oct 2016 12:12:08 +0000 (+0000) Subject: Add const versions of Expr::getInits() and Expr::inits() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b43d2fd5371b870ce46154163e9a158808f8876;p=clang Add const versions of Expr::getInits() and Expr::inits() git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285287 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 46b1c86642..e61e9240a1 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -3783,10 +3783,19 @@ public: /// \brief Retrieve the set of initializers. Expr **getInits() { return reinterpret_cast(InitExprs.data()); } + /// \brief Retrieve the set of initializers. + Expr * const *getInits() const { + return reinterpret_cast(InitExprs.data()); + } + ArrayRef inits() { return llvm::makeArrayRef(getInits(), getNumInits()); } + ArrayRef inits() const { + return llvm::makeArrayRef(getInits(), getNumInits()); + } + const Expr *getInit(unsigned Init) const { assert(Init < getNumInits() && "Initializer access out of range!"); return cast_or_null(InitExprs[Init]);