<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On 27 Oct 2016 5:21 am, "Erik Verbruggen via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: erikjv<br>
Date: Thu Oct 27 07:12:08 2016<br>
New Revision: 285287<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=285287&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=285287&view=rev</a><br>
Log:<br>
Add const versions of Expr::getInits() and Expr::inits()<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/<wbr>Expr.h<br>
<br>
Modified: cfe/trunk/include/clang/AST/<wbr>Expr.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=285287&r1=285286&r2=285287&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/AST/Expr.h?rev=285287&<wbr>r1=285286&r2=285287&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/AST/<wbr>Expr.h (original)<br>
+++ cfe/trunk/include/clang/AST/<wbr>Expr.h Thu Oct 27 07:12:08 2016<br>
@@ -3783,10 +3783,19 @@ public:<br>
   /// \brief Retrieve the set of initializers.<br>
   Expr **getInits() { return reinterpret_cast<Expr **>(InitExprs.data()); }<br></blockquote></div></div></div><div><br></div><div>Is anyone actually storing through this? Can we remove the non-const version?</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+  /// \brief Retrieve the set of initializers.<br>
+  Expr * const *getInits() const {<br>
+    return reinterpret_cast<Expr * const *>(InitExprs.data());<br>
+  }<br>
+<br>
   ArrayRef<Expr *> inits() {<br>
     return llvm::makeArrayRef(getInits(), getNumInits());<br>
   }<br>
<br>
+  ArrayRef<Expr *> inits() const {<br>
+    return llvm::makeArrayRef(getInits(), getNumInits());<br>
+  }<br></blockquote></div></div></div><div><br></div><div>We don't need the non-const version here.</div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
   const Expr *getInit(unsigned Init) const {<br>
     assert(Init < getNumInits() && "Initializer access out of range!");<br>
     return cast_or_null<Expr>(InitExprs[<wbr>Init]);<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div></div>