[foreign] RFR: Port clang-ffi source code to new API

Henry Jen henry.jen at oracle.com
Fri Jun 1 14:24:42 UTC 2018


On Jun 1, 2018, at 4:16 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> I like it - it goes in the right direction of connecting the ABI and layouts more closely together.
> 
> The only bit I don't get is the one on undefined struct - you changed some tests, but you seem to suggest that jextract is not generating an annotation for undefined structs, but that's not the case?
> 
> E.g. if I jextract the following header:
> 
> //testUndefined.h
> 
> typedef struct UndefinedStruct UndefinedStruct;
> 
> int f(struct Foo *p);
> 
> 
> I get back two classes:
> 
> testUndefined.class
> 
> testUndefined$UndefinedStruct.class
> 
> The latter is an annotation for the typedef. So I guess I don't get what you mean when you say " modify test to reflect the removal annotation of undefined struct" - can you please expand on that a little?
> 

You use the same name as struct and typedef, thus in your test case you have UndefinedStruct as the fact it’s a typedef.

See the test case in the webrev, for struct.h

   8 typedef struct UndefineStructForPointer *UndefinedStructPointer;
   9 
  10 struct Opaque* allocate_opaque_struct();

jextract no longer generate UndefineStructForPoitner nor Opaque as annotations.

Cheers,
Henry




More information about the panama-dev mailing list