RFR: 7903933: Move sharable items from different generations to a common file [v3]
Nizar Benalla
nbenalla at openjdk.org
Thu Mar 27 05:55:09 UTC 2025
On Thu, 27 Mar 2025 05:47:11 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:
>> Please review this patch to move the `C_*` layouts and the static utility methods into separate classes: `LayoutUtils.java` and `FFMUtils.java`, respectively.
>>
>> - The names could later be personalized through a JSON configuration.
>> - We can use static imports if the `-t` option is no used and the files are generated into the default package, in that case we use the classname to call the static methods or use the `C_*` constants.
>>
>> Some tests had to be modified slightly, either by adding new static imports or replacing classnames.
>
> Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - add new option to create a sharable utility class
>
> cleanup: longer cmd option `framework` should use -- rather than -
>
> small other cleanups
> - Merge branch 'master' into shareable-items
> - Revert all changes - starting over from scratch
> - replace hardcoded strings I missed
> - move sharable items to a common class
I wasn't happy with the previous approach/implementation and started over from scratch, also did some small cleanup (the newly added option for framworks should use `--` rather than `-`).
Shared items from multiple generation will only be moved to a class if the user specifies the `--sharable-items` option, with the class name of his choosing and the main header file extends that class. This will be helpful for project that need to run jextract on multiple headers, especially if those headers are large.
-------------
PR Comment: https://git.openjdk.org/jextract/pull/278#issuecomment-2756779244
More information about the jextract-dev
mailing list