[foreign-jextract] RFR: 8251893: jextract does not generate source for ConstantHelper even when --source is used [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Aug 17 14:58:59 UTC 2020


On Mon, 17 Aug 2020 14:55:18 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> ConstantHelper.java is generated when --source is used
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
> revision:
>   Fixed constant address (string, NULL) cases. fixed Infinity, NaN floats.

Looks good, added a minor comment in the new impl

src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/SourceConstantHelper.java line 403:

> 402:         indent();
> 403:         String fieldName = getConstantStringFieldName(javaName);
> 404:         append(PRIVATE_MODS);

This should not be named "StringFieldName" since it now refers to both String constants and pointer constants?
Also, perhaps it would be better to just have two methods `emitXYZ` one for strings, and one for address constants,
instead of having one which keeps checking `isAddr` ?

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

Marked as reviewed by mcimadamore (Committer).

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


More information about the panama-dev mailing list