[PATCH] [libclang] getSizeOf/getAlignOf/getOffsetOf (was [PATCH] Expose AST Record layout attributes to libclang)

Loïc Jaquemet loic.jaquemet at gmail.com
Fri Mar 29 09:30:26 PDT 2013


any comments ?

2013/3/25 Loïc Jaquemet <loic.jaquemet at gmail.com>:
>>> Does this handle anonymous structs/unions ? For example:
>>>
>>> struct Test {
>>>   struct {
>>>     union {
>>>       int foo;
>>>     };
>>>   };
>>> };
>>>
>>> If I pass "struct Test", "foo" will it work ? If yes, could you add a
>>> related test ?
>>>
>>
>> It does not work.
>> I will look into that.
>
> And now it does handle anonymous records.
> I added some tests cases and changed the unit test code.
>
> I also removed the duplicate clang_Cursor_getOffsetOf().
> After consideration, it did not make sense, especially in the
> anonymous record situation.
>
> Please see attached diffs.
>
> * Implementation of sizeof, alignof and offsetof for libclang.
> * Unit Tests
> * Python bindings
> * Python tests
>
>
>
>
>
> --
> Loïc Jaquemet



-- 
Loïc Jaquemet




More information about the cfe-commits mailing list