RFR: 7903606: Move layout and function descriptor generation closer to code builders

Jorn Vernee jvernee at openjdk.org
Mon Dec 11 19:16:44 UTC 2023


On Mon, 11 Dec 2023 19:03:42 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/main/java/org/openjdk/jextract/impl/Utils.java line 170:
>> 
>>> 168:     static Function getAsFunctionPointer(Type type) {
>>> 169:         return switch (type) {
>>> 170:             case Type.Delegated delegated -> getAsFunctionPointer(delegated.type());
>> 
>> Same here I think. e.g. not sure this is correct for pointers to function pointers (which are not function pointers themselves)
>
> Not sure here - this function is meant to follow pointers until a function type is found. This method seems to do that?

I was under the impression that this should only find function types for these 2 cases:


   void (*cb)(void)
   void cb(void)


In which case we want to generate a functional interface. The old code also doesn't seem to follow typedefs for instance, but the new code does. This seems like a behavior change.

-------------

PR Review Comment: https://git.openjdk.org/jextract/pull/156#discussion_r1423014051


More information about the jextract-dev mailing list