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 elementType of `Base`, 
but `Builder.CreateStructGEP` assumes the `{i8, i8}` layout implied by `Base`. 
which causes an assert trying to emit code for the second element. So, I've 
added logic to make sure the layout of `STy` and `Dest` are identical, which 
fixes the assert but doesn't break any of the existing testing around aggregate 
stores.

AFAICT the AST and lowering all looks correct, and this is an issue in code 
generation. But this is a new area of clang for me so I'd welcome suggestions 
about if there is a better fix or if the fix should be in a different place. 
Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141690/new/

https://reviews.llvm.org/D141690

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to