aaron.ballman closed this revision.
aaron.ballman added a comment.
Commit in r299981.
https://reviews.llvm.org/D31153
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Ah - perhaps it'd be worth having a standalone forward declaration for
clarity? I don't think I've seen this construct anywhere else in LLVM? But
I could be wrong.
On Tue, Apr 11, 2017 at 10:51 AM Aaron Ballman via Phabricator <
revi...@reviews.llvm.org> wrote:
> aaron.ballman added inline commen
aaron.ballman added inline comments.
Comment at: include/clang/AST/StmtIterator.h:137
+ inline friend StmtIterator
+ cast_away_const(const struct ConstStmtIterator &RHS);
};
dblaikie wrote:
> the "struct" here is a bit atypical/should be removed
The forward re
On Tue, Apr 11, 2017 at 10:27 AM Aaron Ballman via Phabricator <
revi...@reviews.llvm.org> wrote:
> aaron.ballman added inline comments.
>
>
>
> Comment at: include/clang/AST/Expr.h:4025
>child_range children() {
> +const_child_range CCR = const_cast *>(this)->children();
dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.
Looks good to me - thanks!
Comment at: include/clang/AST/StmtIterator.h:137
+ inline friend StmtIterator
+ cast_away_const(const struct ConstStmtIterator &RHS);
};
---
aaron.ballman updated this revision to Diff 94852.
aaron.ballman added a comment.
Addressing review comments.
https://reviews.llvm.org/D31153
Files:
include/clang/AST/Expr.h
include/clang/AST/StmtIterator.h
lib/AST/Expr.cpp
Index: lib/AST/Expr.cpp
aaron.ballman added inline comments.
Comment at: include/clang/AST/Expr.h:4025
child_range children() {
+const_child_range CCR = const_cast(this)->children();
+return child_range(cast_away_const(CCR.begin()),
dblaikie wrote:
> If this is adding const,
dblaikie added inline comments.
Comment at: include/clang/AST/Expr.h:4025
child_range children() {
+const_child_range CCR = const_cast(this)->children();
+return child_range(cast_away_const(CCR.begin()),
If this is adding const, can you use a weaker ca
aaron.ballman updated this revision to Diff 94809.
aaron.ballman added a comment.
Addressing David's review feedback.
https://reviews.llvm.org/D31153
Files:
include/clang/AST/Expr.h
include/clang/AST/StmtIterator.h
lib/AST/Expr.cpp
Index: lib/AST/Expr.cpp
On Mon, Mar 27, 2017 at 10:20 AM Aaron Ballman via Phabricator <
revi...@reviews.llvm.org> wrote:
> aaron.ballman added a comment.
>
> In https://reviews.llvm.org/D31153#711287, @dblaikie wrote:
>
> > As I mentioned to Craig Topper recently on another review, generally
> when implementing const an
aaron.ballman added a comment.
In https://reviews.llvm.org/D31153#711287, @dblaikie wrote:
> As I mentioned to Craig Topper recently on another review, generally when
> implementing const and non-const overloads the non-const is implemented in
> terms of the const overload (& const_casts away c
dblaikie added a comment.
As I mentioned to Craig Topper recently on another review, generally when
implementing const and non-const overloads the non-const is implemented in
terms of the const overload (& const_casts away const on the result). This
ensures no UB if the const overload is called
aaron.ballman added a comment.
Ping.
Because I expect this to be fairly uncontroversial, I'll give it a week in case
folks have comments, then commit (and will handle anything in post-commit
review).
https://reviews.llvm.org/D31153
___
cfe-commit
aaron.ballman updated this revision to Diff 92522.
aaron.ballman added a comment.
Missed a case for `UnaryExprOrTypeTraitExpr`.
https://reviews.llvm.org/D31153
Files:
include/clang/AST/Expr.h
include/clang/AST/StmtIterator.h
lib/AST/Expr.cpp
Index: lib/AST/Expr.cpp
==
aaron.ballman created this revision.
We already have children() but not children() const, which is causing some
problems for me on an out of tree project. Most of the changes here are
mechanical, except for the work done to `ConstStmtIterator`, which cheats and
uses a `const_cast`. Since none o
15 matches
Mail list logo