[cfe-dev] CGRecordLayoutBuilder for Microsoft layout.
r4start
r4start at gmail.com
Sat Oct 22 13:27:28 PDT 2011
On 22/10/2011 23:43, r4start wrote:
> On 22/10/2011 03:12, Eli Friedman wrote:
>> As for the CodeGen bits, they look more complicated than they should
>> be;
> You add vfptroffset it will be very helpful, I'll try to make my code
> simpler.
>> as far as I can tell, the current CodeGen bits are doing the right
>> thing right now,
> Not quite, for example (class D & G from test code)
> struct H : public G,
> public virtual D
> {
> virtual ~H(){}
> };
> code in svn will built
> 0 | struct H
> 0 | struct G (base)
> 0 | int g_field
> 4 | (H vftable pointer)
> 8 | (H vbtable pointer)
> 16 | class D (virtual base)
> 16 | (D vftable pointer)
> 24 | double a
> %struct.H = type { %struct.G, [12 x i8], %class.D }
>
> but right layout is
> 0 | struct H
> 0 | (H vtable pointer)
> 8 | (H vbtable pointer)
> 4 | struct G (base)
> 4 | int g_field
> 16 | class D (virtual base)
> 16 | (D vtable pointer)
> 24 | double a
> %struct.H = type { i32 (...)**, %struct.G, i32*, [4 x i8], %class.D } or
> %struct.H = type { [4 x i8], %struct.G, [8 x i8], %class.D }
>
> So all complicated code needs only for microsoft "madness" like this.
> About example, I'll fix it in few days and publish patch.
>
This patch fixes the bug.
- Dmitry.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ms-layout.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111023/de782a08/attachment.ksh>
More information about the cfe-dev
mailing list