r192288 - Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumVTableBuilder and clang-format code around

Timur Iskhodzhanov timurrrr at google.com
Thu Oct 10 03:32:53 PDT 2013


2013/10/9 Reid Kleckner <rnk at google.com>:
> On Wed, Oct 9, 2013 at 4:33 AM, Timur Iskhodzhanov <timurrrr at google.com>
> wrote:
>>
>> Author: timurrrr
>>
>>
>> Modified: cfe/trunk/lib/CodeGen/CGVTables.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.h?rev=192288&r1=192287&r2=192288&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGVTables.h (original)
>> +++ cfe/trunk/lib/CodeGen/CGVTables.h Wed Oct  9 06:33:51 2013
>> @@ -33,7 +33,7 @@ class CodeGenVTables {
>>
>>    // FIXME: Consider moving VTContext and VFTContext into respective
>> CXXABI
>>    // classes?
>> -  VTableContext VTContext;
>> +  ItaniumVTableContext VTContext;
>>    OwningPtr<MicrosoftVFTableContext> VFTContext;
>>
>>    /// VTableAddressPointsMapTy - Address points for a single vtable.
>> @@ -72,7 +72,7 @@ public:
>>
>>    CodeGenVTables(CodeGenModule &CGM);
>>
>> -  VTableContext &getVTableContext() { return VTContext; }
>> +  ItaniumVTableContext &getVTableContext() { return VTContext; }
>>
>>    MicrosoftVFTableContext &getVFTableContext() { return
>> *VFTContext.get(); }
>
>
> Long term, we don't need both VFTableContext and ItaniumVTableContext,
> right?

Yes

> Are we going to move to a common base like CGCXXABI with getters
> that downcast and assert that we're in the right ABI?
>
> One thing I wanted to do was get rid of the downcasting entirely by doing
> something like giving the CGCXXABIs factory methods for the ABI-specific
> manglers, record builders, and vtable builders.
>
> Then MicrosoftCXXABI can keep a reference to the MicrosoftMangleContext
> without having to get it back from CGM with a downcast.

I'm not sure.
Intuitively, I think we should just put the vcontexts into respective
CGCXXABI subclasses.
This might make the rest of the architecture more complex though, so
I'd like to postpone the decision until we have more data.



More information about the cfe-commits mailing list