[PATCH] D76438: ConstantExpr cached APValues if present for constant evaluation

Wyatt Childers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 20 14:40:11 PDT 2020


wchilders marked 2 inline comments as done.
wchilders added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:7325-7329
+  // Override to perform additional checks to ensure the cached APValue
+  // is actually an LValue.
+  bool VisitConstantExpr(const ConstantExpr *E) {
+    assert(!E->hasAPValueResult() || E->getAPValueResult().isLValue());
+    return ExprEvaluatorBaseTy::VisitConstantExpr(E);
----------------
rsmith wrote:
> I think this override is now fully redundant and can be removed: the `isLValue()` assert is reached anyway when `DerivedSuccess` calls `LValueExprEvaluatorBase::Success` which calls `LValue::setFrom`.
Good catch, updated the patch to drop this. :)


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

https://reviews.llvm.org/D76438





More information about the cfe-commits mailing list