Add const versions of Expr::getInits() and Expr::inits()

llvm-svn: 285287
This commit is contained in:
Erik Verbruggen 2016-10-27 12:12:08 +00:00
parent 46c0278e7d
commit 5bd830a5c5
1 changed files with 9 additions and 0 deletions

View File

@ -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]);