[PATCH] D57098: [WIP][AST] NFC: Introduce new class GenericSelectionExpr::Association

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 23 07:51:53 PST 2019


riccibruno marked an inline comment as done.
riccibruno added inline comments.


================
Comment at: include/clang/AST/Expr.h:5208
+  ArrayRef<Expr *> getAssocExprs() const {
+    return {reinterpret_cast<Expr *const *>(getTrailingObjects<Stmt *>() +
+                                            ASSOC_EXPR_START),
----------------
riccibruno wrote:
> aaron.ballman wrote:
> > Do we need to use `reinterpret_cast` here, or can this be done through llvm's casting machinery instead?
> I believe that it is needed, because `Stmt **` is not otherwise convertible to `Expr **`. This is all over the place in the statement/expression nodes, and indeed it depends on the layout of `Expr` and `Stmt`.
Ugh ignore the comment about the layout. I was thinking about the `reinterpret_cast`s between `Stmt *` and `Expr *` in `Stmt.h`


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57098/new/

https://reviews.llvm.org/D57098





More information about the cfe-commits mailing list