[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-18 Thread Ties Stuij via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. stuij marked an inline comment as done. Closed by commit rG27cbfa7cc8cd: [Clang] Propagate const context info when emitting compound literal (authored by stuij). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-18 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett accepted this revision. DavidSpickett added a comment. My comment was addressed, LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131555/new/ https://reviews.llvm.org/D131555 ___ cfe-com

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-18 Thread Ties Stuij via Phabricator via cfe-commits
stuij marked an inline comment as done. stuij added inline comments. Comment at: clang/test/CodeGen/const-init.c:2 +// setting strict FP behaviour in the run line below tests that the compiler +// does the right thing for global compound literals (compoundliteral test) +// RUN: %

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-18 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 453579. stuij added a comment. addressed review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131555/new/ https://reviews.llvm.org/D131555 Files: clang/lib/CodeGen/CGExprConstant.cpp clang/lib/CodeGe

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-17 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. This seems reasonable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131555/new/ https://reviews.llvm.org/D131555 _

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-17 Thread David Spickett via Phabricator via cfe-commits
DavidSpickett added inline comments. Comment at: clang/test/CodeGen/const-init.c:2 +// setting strict FP behaviour in the run line below tests that the compiler +// does the right thing for global compound literals (compoundliteral test) +// RUN: %clang_cc1 -no-opaque-pointers -t

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Ties Stuij via Phabricator via cfe-commits
stuij marked 2 inline comments as done. stuij added inline comments. Comment at: clang/lib/CodeGen/CGExprConstant.cpp:2217 assert(E->isFileScope() && "not a file-scope compound literal expr"); - return tryEmitGlobalCompoundLiteral(*this, nullptr, E); + ConstantEmitter emitte

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 451794. stuij added a comment. addressed review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131555/new/ https://reviews.llvm.org/D131555 Files: clang/lib/CodeGen/CGExprConstant.cpp clang/lib/CodeGe

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Victor Campos via Phabricator via cfe-commits
vhscampos added inline comments. Comment at: clang/lib/CodeGen/CGExprConstant.cpp:2217 assert(E->isFileScope() && "not a file-scope compound literal expr"); - return tryEmitGlobalCompoundLiteral(*this, nullptr, E); + ConstantEmitter emitter(*this, nullptr); + return tryEmit

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Victor Campos via Phabricator via cfe-commits
vhscampos added inline comments. Comment at: clang/lib/CodeGen/CGExprConstant.cpp:2217 assert(E->isFileScope() && "not a file-scope compound literal expr"); - return tryEmitGlobalCompoundLiteral(*this, nullptr, E); + ConstantEmitter emitter(*this, nullptr); + return tryEmit

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 451783. stuij marked an inline comment as done. stuij added a comment. also added a comment above the runline. Initially thought it wouldn't be necessary as we're now doing a check, but I do agree that it's more clear to be specific about the cmdline arg. Re

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-11 Thread Ties Stuij via Phabricator via cfe-commits
stuij updated this revision to Diff 451781. stuij added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131555/new/ https://reviews.llvm.org/D131555 Files: clang/lib/CodeGen/CGExprConstant.cpp clang/lib/CodeG

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-10 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added a comment. The clang code change looks reasonable to me, but I'm not the most expert in that area. The intended result certainly seems sensible, because the C90-compatible version of that code //without// a constant literal is happy to do doubleā†’float conversion at compile t

[PATCH] D131555: [Clang] Propagate const context info when emitting compound literal

2022-08-10 Thread Ties Stuij via Phabricator via cfe-commits
stuij created this revision. Herald added a project: All. stuij requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes a crash when trying to emit a constant compound literal. For C++ Clang evaluates either casts or binary operat