[PATCH] D77592: [NFC}[CodeGen] Make VTable initialization a method of CGCXXABI

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 13:35:07 PDT 2020


leonardchan added a comment.

In D77592#1975629 <https://reviews.llvm.org/D77592#1975629>, @rjmccall wrote:

> This is a weird point to allow further ABI customization of.  I understand why you want to customize this, but I wonder if it's actually worthwhile to make a `virtual` function for it vs. just checking some sort of flag in the builder.  Isn't there quite a lot of structure you're going to have to duplicate just to call `addRelativeAddress` at the leaves?


Based off the work I've done so far, I wasn't necessarily duplicating existing code, but more moving it into virtual functions so I can override them with new logic. I think I'd end up with the same result regardless of if I use virtual functions or check a flag somewhere since, in the end, I'll need a switch somewhere that says I should use this new vtable logic in specific areas of the code. Where that switch would be (through virtual functions/a compiler flag/a cmake flag), I don't have strong opinions.

The main thing that I'm unsure of though is if it's ok to have all these customisations. Based off what I have so far, I'd like to add a few more virtual functions (~8 that FuchsiaCXXABI overrides), so it would be checking one switch in many different areas.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77592





More information about the cfe-commits mailing list