[cfe-dev] Move VTableContext & friends from AST to CodeGen?

John McCall rjmccall at apple.com
Wed May 15 21:47:41 PDT 2013

On May 15, 2013, at 12:55 PM, Peter Collingbourne <pcc at google.com> wrote:
> My opinion is that the VTableContext-level interfaces for the two ABIs (were they to exist) should be two separate interfaces without a base class, since the details are fundamentally different at that level, and that they can later be unified at the CodeGen level.  Since I'm guessing that you don't really need a VTableContext equivalent if you're only interested in LLVM IR generation, you could consider implementing Microsoft vtable stuff wholly within CodeGen, while keeping the Itanium VTableContext in AST.  (With sufficient interest, someone could factor the relevant parts of the Microsoft vtable builder to AST as I did for Itanium.)

I agree that there's really no reason to pretend that there's a common interface here;  we should have an ItaniumVTableContext and a MicrosoftVTableContext.  However, please maintain the current design where the abstract layout for the vftbl and vbtbl are generated in the AST library and then consumed by IR-generation.


More information about the cfe-dev mailing list