[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-08 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG878d96011acc: [clang][CodeGen] Handle throw expression in conditional operator constant… (authored by tambre, committed by rsmith). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-07 Thread Raul Tambre via Phabricator via cfe-commits
tambre marked an inline comment as done. tambre added a comment. Updated the comment. Please commit this for me, as I lack commit privileges. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77502/new/ https://reviews.llvm.org/D77502

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-07 Thread Raul Tambre via Phabricator via cfe-commits
tambre updated this revision to Diff 255607. tambre marked an inline comment as done. tambre added a comment. Update comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77502/new/ https://reviews.llvm.org/D77502 Files:

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-06 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. Looks good (with the comment suitably tweaked). Thanks! Comment at: clang/lib/CodeGen/CGExpr.cpp:4334 incrementProfileCounter(expr); + // If a throw expression

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-06 Thread Raul Tambre via Phabricator via cfe-commits
tambre added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:4337 +EmitCXXThrowExpr(ThrowExpr); +return EmitLValue(dead); + } rsmith wrote: > The IR we emit for the dead operand is unreachable; it's a bit wasteful to > generate it

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-06 Thread Raul Tambre via Phabricator via cfe-commits
tambre updated this revision to Diff 255275. tambre marked 4 inline comments as done. tambre added a comment. Emit undef lvalue, add throw CHECK to test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77502/new/ https://reviews.llvm.org/D77502

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:4337 +EmitCXXThrowExpr(ThrowExpr); +return EmitLValue(dead); + } The IR we emit for the dead operand is unreachable; it's a bit wasteful to generate it here and

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-05 Thread Raul Tambre via Phabricator via cfe-commits
tambre updated this revision to Diff 255175. tambre added a comment. Fix formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77502/new/ https://reviews.llvm.org/D77502 Files: clang/lib/CodeGen/CGExpr.cpp

[PATCH] D77502: [clang][CodeGen] Handle throw expression in conditional operator constant folding

2020-04-05 Thread Raul Tambre via Phabricator via cfe-commits
tambre created this revision. tambre added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. tambre edited the summary of this revision. We're smart and do constant folding when emitting conditional operators. Thus we emit the live value as a lvalue. This