[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-11-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbd4662cd3f37: [AST] Enhance the const expression evaluator to support error-dependent exprs. (authored by hokein). Repository: rG LLVM Github

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-11-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D84637#2345353 , @rsmith wrote: > There are a couple of cases where you're returning `EvalStmtResult` from a > function with a `bool` return type, that I'd like to see fixed before this > lands. > > All the other comments are

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-11-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 306015. hokein marked 9 inline comments as done. hokein added a comment. rebase and address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 Files:

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-10-21 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. (Accepted subject to previous comment.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-10-21 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. There are a couple of cases where you're returning `EvalStmtResult` from a function with a `bool` return type, that I'd like to see fixed before this lands. All the other comments are directed towards producing more precise behavior when evaluating a function

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-10-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. friendly ping @rsmith :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. @rsmith this patch should be ready for another round of review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 ___ cfe-commits mailing

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 293538. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4583 if (!InitE) return getDefaultInitValue(VD->getType(), Val); rsmith wrote: > The initializer might also be null because the variable is type-dependent > (eg, `X x;`), in

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 290754. hokein marked an inline comment as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 Files:

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-08 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4583 if (!InitE) return getDefaultInitValue(VD->getType(), Val); The initializer might also be null because the variable is type-dependent (eg, `X x;`), in which case assuming

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-09-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. friendly ping @rsmith. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. friendly ping @rsmith, the patch is ready for another round of review. Would be nice to have it in clang11. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4961 } +if (IS->getCond()->isValueDependent()) + return EvaluateDependentExpr(IS->getCond(), Info); The `if` stmt (the same to

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282917. hokein added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/ https://reviews.llvm.org/D84637 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-08-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 282916. hokein added a comment. address review comments: - treat contains-errors expression as being potentially constant; - handle the value-dependent expressions for EvaluateInPlace; - remove the bailing out for constructor initializers that contains

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-07-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D84637#2175681 , @erichkeane wrote: > Based on richard's suggestions, that seems about right. However I believe > all the asserts should have a message to go along with them as we typicaly do. In this case, the asserts are

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-07-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:4876 +assert(E->containsErrors()); +return ESR_Failed; + } This should not result in failure when checking for a potential constant expression; if an expression

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-07-27 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Based on richard's suggestions, that seems about right. However I believe all the asserts should have a message to go along with them as we typicaly do. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84637/new/

[PATCH] D84637: [AST] Enhance the const expression evaluator to support error-dependent exprs.

2020-07-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix a crash when evaluating a constexpr function which contains recovery-exprs. https://bugs.llvm.org/show_bug.cgi?id=46837 Would be nice to have constant expression evaluator support general