================
@@ -21964,11 +22000,23 @@ bool Expr::EvaluateAsRValue(EvalResult &Result, const
ASTContext &Ctx,
assert(!isValueDependent() &&
"Expression evaluator can't be called on a dependent expression.");
ExprTimeTraceScope TimeScope(this, Ctx, "EvaluateAsRValue");
- EvalInfo Info(Ctx, Result, EvaluationMode::IgnoreSideEffects);
+ EvalInfo Info(Ctx, /*Sema=*/nullptr, Result,
+ EvaluationMode::IgnoreSideEffects);
Info.InConstantContext = InConstantContext;
return ::EvaluateAsRValue(this, Result, Ctx, Info);
}
+bool Expr::EvaluateAsMandatedConstantRValue(EvalResult &Result,
----------------
katzdm wrote:
I think that's essentially what I'm doing here - They're both very thin
wrappers around `::EvaluateAsRValue`.
But I would hesitate to make the wrappers "thinner" than this:
- I think the assertion that the expression is not value-dependent should be
done as early as possible, so I'd rather keep it in the wrapper.
- The `TimeScope` should arguably use the name of the function being called,
rather than the shared "internal" one.
I suppose we _could_ construct the `EvalInfo` within `::EvaluateAsRValue`, but
we only take two lines to set it up here.
I'd prefer to keep as-is, but let me know what you think.
https://github.com/llvm/llvm-project/pull/205557
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits