[foreign] RFR 8217462: Add a jextract option to not generate typedef annotation interfaces
Jorn Vernee
jbvernee at xs4all.nl
Tue Jan 22 21:31:30 UTC 2019
Hi Maurizio,
Thanks for the feedback.
Your arguments are compelling (as always). Indeed, part of the problem
is that typedefs are not being filtered based on library currently.
Maybe I'm wrong, but I expect there is an intent to add the typedef
annotations to get generated function signatures as well? At that point
having a --no-typdef option to stop the annotations from being generated
might be more useful.
Otherwise, while having a full menu of options in stock jextract might
not be desirable, maybe extra tree phases could be added through some
plugin API? Or is jextract intended to be kept simpler than that?
Jorn
Maurizio Cimadamore schreef op 2019-01-22 22:10:
> Hi Jorn,
> while I understand where you are coming from, I'd like not to fragment
> the space of the jextract options too much - as discussed earlier
> today, there is already enough confusion over existing options, and we
> should clear that before adding new ones :-)
>
> Also, if we go down this path, I'm afraid that this will turn into
> having a full menu of options to support this or that generation tweak
> - this sort of things tend to add up, the options will likely be
> (ab)used in any possible configuration, with the result that the
> jextract output will be perceived as something not stable.
>
> I have also a sense that your request is coming in part from issues
> that were pointed out few days ago - e.g. jextract is currently
> generating too much stuff - even things that have nothing to do with
> the library being extracted (but which is recursively included by the
> headers). As we have said then, the solution for this problem is to
> adopt a library-centric approach, not adding custom flags to
> selectively switch off extraction features.
>
> Maurizio
>
> On 22/01/2019 19:48, Jorn Vernee wrote:
>> Hi,
>>
>> From the bug description:
>>
>> Currently jextract generates annotation interfaces for typedefs. But,
>> using these annotations is not required to call the native functions
>> defined in a library. Rather, they are there to add additional
>> metadata to java carrier types.
>>
>> Since use of these annotations interfaces is optional, it would be
>> nice to have a jextract option to turn of their generation, in order
>> to simplify generated classes (especially useful when viewing them
>> with a decompiler/javap)
>>
>> Please review the following.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8217462
>> Webrev:
>> http://cr.openjdk.java.net/~jvernee/panama/webrevs/8217462/webrev.00/
>>
>> Thanks,
>> Jorn
More information about the panama-dev
mailing list