[PATCH] D62009: [clang] perform semantic checking in constant context

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 13:14:07 PDT 2019


rsmith added a comment.

In D62009#1505263 <https://reviews.llvm.org/D62009#1505263>, @Tyker wrote:

> i added this bit because when we eventually store the result of evaluation in ConstantExpr we will probably want to trail-allocate the APValue's possible representations separately to limit memory consumption. but if we do this the ConstantExpr node will need to be created after evaluation of the value to allocate the right space and we will need an other way to mark that the expression should be evaluated in constant context.


Even if we want to tail-allocate (which does seem like a nice idea in the long term), we don't need to mark the expression for that: we can pass a flag into the constant evaluator to indicate that we're evaluating an expression with the intent of forming a `ConstantExpr`. (We already do that for `EvaluateAsRValue`; we'll need to do the same for other entry points that could be evaluating at the top level in a constant context.)


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

https://reviews.llvm.org/D62009





More information about the cfe-commits mailing list