[PATCH] D150746: [CodeGen]Translating pointer arguments can require an address space cast

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 15:23:58 PDT 2023


rjmccall added a comment.

I see.  Yes, in that case I think you're right that we can't test this yet — only base-subobject ctors and dtors get VTT parameters, we only emit calls to those from other ctors and dtors, and those ctors and dtors will always have their own stores to the v-table slot that will be invalid IR.  So I agree with the plan of building up an XFAILed test.  You should be able to locally build up that test by just adding an early return to `CodeGenFunction::InitializeVTablePointer` — obviously that will break a bunch of other tests, but as long as you don't commit it, you can create a fairly complete test case that at least should work in the future.  I find it helpful to do that as you're going instead of going back at the end of a patch series and trying to add tests for all the cases you implemented.  Please test (1) the declarations of base-subobject ctors/dtors, (2) the initial passing of the VTT argument from complete-object to base-subobject ctors/dtors, and (3) the forwarding of VTT arguments in base-subobject ctors/dtors to the ctors/dtors of their own base subobjects.

The actual code LGTM.


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

https://reviews.llvm.org/D150746



More information about the cfe-commits mailing list