[foreign-jextract] RFR: 8257892: long double not handled by jextract [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Dec 8 14:17:23 UTC 2020


On Tue, 8 Dec 2020 13:51:42 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> added UnsupportedLayouts and checking/warning all unsupported types uniformly
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   missed checking CHAR16 in UnsupportedLayouts.

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/UnsupportedLayouts.java line 36:

> 34: 
> 35:     public static final ValueLayout __INT128 = MemoryLayout.ofValueBits(128, ByteOrder.nativeOrder()).
> 36:             withName("__int128").withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.LONG_LONG);

We could add an attribute to unsupported layouts - that way the test would probably be easier (e.g. just check that the attribute is there) - and more robust to layout manipulations

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/OutputFactory.java line 401:

> 399: 
> 400:         if (isUnsupported(layout)) {
> 401:             warn("skipping " + fieldName + " because of unsupported type usage: " + layout.name().get());

shouldn't we have two warnUnsupported, one taking a layout, and one taking a descriptor - and have some code reuse between them?

test/jdk/tools/jextract/testStruct/struct.h line 54:

> 52:     float f;
> 53:     double d;
> 54:     long double ld;

Should we add tests for when the unsupported types appear in different positions:

* return type
* argument type
* struct field
* global

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

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


More information about the panama-dev mailing list