[foreign-jextract] Integrated: 8274155 Foreign API refresh - jextract update

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Sep 23 10:53:34 UTC 2021


On Wed, 22 Sep 2021 15:31:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> These are the jextract changes for the recent refresh of the Foreign Memory Access/Foreign Linker API. The biggest change in this API refresh comes from the removal of layout attributes. Jextract used to store several information in the form of layouts attributes. After some analysis, it turned out that in all cases, the use of layout attributes was not necessary, and it was really driven by the fact that jextract was, in certain places, using `MemoryLayout` as its main internal representation, instead of using the more flexible `Declaration`/`Type` APIs. Unfortunately, updating `RecordLayoutComputer` to work on `Declaration` rather than `MemoryLayout` caused changes in several part of the jextract parsing frontend.
> 
> Other minor changes were required, to adjust jextract to the new API changes - but most of these are small. I've dropped several now redundant overloads (so the size of the generated bindings should be smaller). There's also an additional piece of code which is used to emit typedef for common C primitive types such as `C_INT` and the likes (since the layouts for these are no longer in `CLinker`).
> 
> The test changes are mostly trivial updates to use the new API.

This pull request has now been integrated.

Changeset: 80e0d4b9
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/80e0d4b952912980ff6cc318330efdc8d9340277
Stats:     1572 lines in 80 files changed: 535 ins; 681 del; 356 mod

8274155: Foreign API refresh - jextract update

Reviewed-by: sundar

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

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


More information about the panama-dev mailing list