[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-12 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG08ba9ce1ef72: Suppress Deferred Diagnostics in discarded statements. (authored by erichkeane). Changed prior to commit: https://reviews.llvm.org/D102251?vs=344813=344920#toc Repository: rG LLVM

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-12 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/include/clang/AST/EvaluatedExprVisitor.h:37 + // 'constexpr-if'. + bool shouldVisitDiscardedCase() const { return true; } #define PTR(CLASS) typename Ptr::type rsmith wrote: > Maybe

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-12 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. Comment at: clang/include/clang/AST/EvaluatedExprVisitor.h:37 + // 'constexpr-if'. + bool shouldVisitDiscardedCase() const { return true; } #define PTR(CLASS) typename Ptr::type Maybe

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-12 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 344813. erichkeane added a comment. Moved `IfStmt`/discarded case logic to ExprEvaluatorBase per @rsmith 's suggestion. This is the 'highest' in the tree that has a `Sema`/`ASTContext` reference, so anything 'higher' in the tree would be higher touch.

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-12 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/Stmt.cpp:1000-1003 + if (Optional Result = + const_cast(this)->getNondiscardedCase(Ctx)) +return *Result; + return None; rsmith wrote: > Can this simply be > ``` > return

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. (No blocking concerns here.) Comment at: clang/lib/AST/Stmt.cpp:1000-1003 + if (Optional Result = + const_cast(this)->getNondiscardedCase(Ctx)) +return *Result; + return None; Can this simply be ``` return

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102251/new/ https://reviews.llvm.org/D102251 ___ cfe-commits mailing list

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. LGTM for CUDA. This matches the intent of deferred diags -- we only emit them if we get to generate the code for the sources that triggered them, so they should not show up for the false constexpr branches. Repository: rG LLVM Github Monorepo

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D102251#2751226 , @erichkeane wrote: > In D102251#2751101 , @ABataev wrote: > >> LG > > Thanks! I'm going to give @yaxunl a day to take a look that this, > particularly since the

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D102251#2751101 , @ABataev wrote: > LG Thanks! I'm going to give @yaxunl a day to take a look that this, particularly since the only test I could come up with was CUDA based. Repository: rG LLVM Github Monorepo

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102251/new/ https://reviews.llvm.org/D102251

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/include/clang/AST/Stmt.h:2082-2083 /// Otherwise, or if the condition is value-dependent, returns None. Optional getNondiscardedCase(const ASTContext ) const; + Optional getNondiscardedCase(const ASTContext );

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/Stmt.h:2082-2083 /// Otherwise, or if the condition is value-dependent, returns None. Optional getNondiscardedCase(const ASTContext ) const; + Optional getNondiscardedCase(const ASTContext );

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added reviewers: yaxunl, bader, ABataev, aaron.ballman. erichkeane requested review of this revision. Herald added a project: clang. It doesn't really make sense to emit language specific diagnostics in a discarded statement, and suppressing these