[cfe-commits] r77458 - /cfe/trunk/lib/CodeGen/CGCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Jul 29 09:07:31 PDT 2009


On Jul 29, 2009, at 8:59 AM, Anders Carlsson wrote:

>
> 29 jul 2009 kl. 08.54 skrev Fariborz Jahanian:
>
>> Author: fjahanian
>> Date: Wed Jul 29 10:54:56 2009
>> New Revision: 77458
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77458&view=rev
>> Log:
>> Use the existing API for base offset. Use suitable llvm type
>> for offset ir-gen.
>>
>
> Great! This means that we can remove the extra field offsets for  
> base classes now, right?

Yes, I will clean up today.

>
>
>> -  if (!DerivedToBaseConversion) {
>> -    assert(false && "FIXME - Only derived to imm. base convesion  
>> is supported");
>> -    return BaseValue;
>> -  }
>> -  uint64_t Offset = Layout.getFieldOffset(Idx) / 8;
>> -  llvm::Value *OffsetVal =  
>> llvm::ConstantInt::get(llvm::Type::Int32Ty, Offset);
>> +  uint64_t Offset = Layout.getBaseClassOffset(BaseClassDecl) / 8;
>
> I'm thinking now that we should make getBaseClassOffset return the  
> offset in bytes, it never makes sense to have it in bits. What do  
> you think?
Agreed.

>
>
> Also, does this handle multi-level inheritence?
>
> class A { }; class B : A { }; class C : B { };

Not yet. But it will build upon the above API. I will do this next.  
Thanks for the above API.

- Fariborz

>
>
> Anders
>




More information about the cfe-commits mailing list