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

2020-04-13 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Thanks. Having an enum like this would also be important if we wanted to implement the Itanium rule (as in, the actual Itanium architecture, not the generic C++ ABI) that v-tables contain "inline" function descriptors rather than pointers to them. (On Itanium, a C fu

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

2020-04-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In D77592#1979030 , @rjmccall wrote: > This is a global switch, right, not something that's mix-and-match between > hierarchies or even between classes? I think I would prefer that the ABI > object just tell us the expected

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

2020-04-13 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. This is a global switch, right, not something that's mix-and-match between hierarchies or even between classes? I think I would prefer that the ABI object just tell us the expected layout of a v-table entry (as an enum) rather than forcing a bunch of different callbac

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

2020-04-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In 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 i

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

2020-04-10 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. 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 struc

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

2020-04-06 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: pcc, rjmccall, rsmith. leonardchan added a project: clang. This patch moves the following instances of this snippet: ConstantInitBuilder builder(CGM); auto components = builder.beginStruct(); CGVT.createVTableInitializer(compon