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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to