[PATCH] D85960: [AST][FPEnv] Keep FP options in trailing storage of CastExpr

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 11:58:35 PDT 2020


riccibruno added a comment.

> This change allow a CallExpr to have optional FPOptionsOverride object,

Should this be `CastExpr` instead?

> stored in trailing storage. The implementaion is made similar to the way
> used in CallExpr.

Nit, but that's not really similar. In the `CallExpr` case the trailing objects are directly managed by `CallExpr` without using `TrailingObjects` in the sub-classes.



================
Comment at: clang/include/clang/AST/Expr.h:3471
 
+  /// Return a pointer to the trailing FPOptions.
+  FPOptionsOverride *getTrailingFPFeatures();
----------------
Can you document that `hasStoredFPFeatures()` must  be true as a pre-condition?


================
Comment at: clang/include/clang/AST/Expr.h:3612
 
+  unsigned numTrailingObjects(OverloadToken<CXXBaseSpecifier *>) const {
+    return path_size();
----------------
Here and elsewhere: `numTrailingObjects` is not part of the public interface.


================
Comment at: clang/include/clang/AST/ExprCXX.h:475
       : CXXNamedCastExpr(CXXDynamicCastExprClass, ty, VK, kind, op, pathSize,
-                         writtenTy, l, RParenLoc, AngleBrackets) {}
+                         false, writtenTy, l, RParenLoc, AngleBrackets) {}
 
----------------
`/*frob=*/false` here and elsewhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85960



More information about the cfe-commits mailing list