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

2020-03-20 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbe10b7e43a3a: Use values cached in ConstantExprs for expression evaluation where present. (authored by wchilders, committed by rsmith). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-03-20 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders updated this revision to Diff 251763. wchilders marked an inline comment as done. wchilders added a comment. Dropped the override for constexpr evaluator, LValue evaluation base class CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76438/new/ https://reviews.llvm.org/D76438 Fil

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

2020-03-20 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders added a comment. I should note, I don't have commit access, so I'm unable to commit this myself. Attribution would be `Wyatt Childers ` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76438/new/ https://reviews.llvm.org/D76438 ___

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

2020-03-20 Thread Wyatt Childers via Phabricator via cfe-commits
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)

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

2020-03-20 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/AST/ExprConstant.cpp:7325-7329 + // Override to perform additional checks to ensure the cached APValue + // is actually an LValue. + bool VisitCo

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

2020-03-20 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders updated this revision to Diff 251732. wchilders added a comment. Updated to assume LValue `ConstantExpr`s have LValue `APValue`s, with verification in debug mode. Additionally, added a missing LValue -> RValue conversion for `VerifyIntegerConstantExpression`. CHANGES SINCE LAST ACTIO

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

2020-03-20 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders marked 2 inline comments as done. wchilders added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:7329 + if (Result.isLValue()) +return Success(Result, E); +} rsmith wrote: > wchilders wrote: > > rsmith wrote: > > > wchilder

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

2020-03-19 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:7329 + if (Result.isLValue()) +return Success(Result, E); +} wchilders wrote: > rsmith wrote: > > wchilders wrote: > > > This doesn't seem to be the right answer, and `Const

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

2020-03-19 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders marked an inline comment as done. wchilders added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:7329 + if (Result.isLValue()) +return Success(Result, E); +} rsmith wrote: > wchilders wrote: > > This doesn't seem to be the

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

2020-03-19 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/Expr.cpp:2875 - else if (auto *CE = dyn_cast(E)) -return CE->getSubExpr(); - return E; } wchilders wrote: > `IgnoreParensSingleStep` for some reason has been unwrapping `ConstantExpr`s. > This re

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

2020-03-19 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders added inline comments. Comment at: clang/lib/AST/Expr.cpp:2875 - else if (auto *CE = dyn_cast(E)) -return CE->getSubExpr(); - return E; } `IgnoreParensSingleStep` for some reason has been unwrapping `ConstantExpr`s. This results in the const

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

2020-03-19 Thread Wyatt Childers via Phabricator via cfe-commits
wchilders created this revision. wchilders added reviewers: Tyker, rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch allows the constant evaluator to use `APValueResult`s from `ConstantExpr`s. There are some outstanding concerns I'll mark with inline comme