[foreign-jextract] RFR: 8281764: jextract does not generate parameter names for function pointer typedefs

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Feb 18 14:31:15 UTC 2022


On Fri, 18 Feb 2022 12:42:39 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

> Propagating TypedefDecl's ParmDecl child cursors to Types.

Looks good - I've added a suggestion to perhaps reduce the impact of the changes on TypeMaker.

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/TypeMaker.java line 127:

> 125:     }
> 126: 
> 127:     Type makeTypeInternal(jdk.internal.clang.Type t, List<Declaration.Variable> params) {

I believe you can avoid all the changes to this method, and have a simple method on FunctionType which gets a parameter name list and gives you a _new_ function type with the list in it - e.g. `withParameterNames`. Then you can call that method from `TreeMaker` _after_ you have parsed a `Type`.

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

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/646


More information about the panama-dev mailing list