[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-02-23 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google abandoned this revision. luken-google added a comment. seems to have fixed itself.. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141690/new/ https://reviews.llvm.org/D141690 ___ cfe-commits

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1338 + llvm::StructType *STy = dyn_cast(Val->getType()); + if (STy && STy->canLosslesslyBitCastTo(Dest.getElementType())) { for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:1338 + llvm::StructType *STy = dyn_cast(Val->getType()); + if (STy && STy->isLayoutIdentical(cast(Dest.getElementType( { for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { ---

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google updated this revision to Diff 489058. luken-google added a comment. Add newline at end of test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141690/new/ https://reviews.llvm.org/D141690 Files: clang/docs/ReleaseNotes.rst cla

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google updated this revision to Diff 489057. luken-google added a comment. Adds test and release note, refactors to avoid possible null pointer deref. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141690/new/ https://reviews.llvm.org/D141690

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a subscriber: jyknight. ilya-biryukov added a comment. Sorry, didn't see your comment when submitting mine. I think the offending code is clearly wrong here and adding the `isLayoutIdentical` seems like the right thing to do. This looks like a small change and I'm happy to L

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. The change seems reasonable. Could you add a test with a crasher repro and some validation of the generated IR? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141690/new/ https://reviews.llvm.org/D141690

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google added a comment. See: https://github.com/llvm/llvm-project/issues/53983 I can add a release note and some testing, but wanted feedback that this was the right approach. The problem is when generating code for the constructor for the `bar` element inside of `MyStruct`, `Dest` has an

[PATCH] D141690: [clang] fix consteval ctor code generation assert

2023-01-13 Thread Luke Nihlen via Phabricator via cfe-commits
luken-google created this revision. Herald added a project: All. luken-google requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes GH#53983. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D141690 Files: clang/lib/Code