r285287 - Add const versions of Expr::getInits() and Expr::inits()
Erik Verbruggen via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 27 05:12:09 PDT 2016
Author: erikjv
Date: Thu Oct 27 07:12:08 2016
New Revision: 285287
URL: http://llvm.org/viewvc/llvm-project?rev=285287&view=rev
Log:
Add const versions of Expr::getInits() and Expr::inits()
Modified:
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=285287&r1=285286&r2=285287&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Oct 27 07:12:08 2016
@@ -3783,10 +3783,19 @@ public:
/// \brief Retrieve the set of initializers.
Expr **getInits() { return reinterpret_cast<Expr **>(InitExprs.data()); }
+ /// \brief Retrieve the set of initializers.
+ Expr * const *getInits() const {
+ return reinterpret_cast<Expr * const *>(InitExprs.data());
+ }
+
ArrayRef<Expr *> inits() {
return llvm::makeArrayRef(getInits(), getNumInits());
}
+ ArrayRef<Expr *> 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<Expr>(InitExprs[Init]);
More information about the cfe-commits
mailing list