RFR: 7903606: Move layout and function descriptor generation closer to code builders [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Dec 11 19:40:06 UTC 2023


> This PR moves calls to Type/Declaration.layoutFor/descriptorFor as close as possible to the leaf code builders. The reason for this change is to prepare the jextract code to generate layouts and descrptor strings directly from jextract types, so that we can retain as much information from the original clang cursor/types as possible when generating layouts.
> 
> In order to get there, I had to add a lot of type predicates in the Utils class (perhaps some of these methods can be moved later directly in TypeImpl).
> 
> And, perhaps the biggest change, is that previously we used layout presence/absence in `UnsupportedFilter` to make decision as to whether skip a certain declaration. For this reason, `UnsupportedFilter` (esp. its type visitor) has been enhanced to detect cases where layout generation would fail, but in a way that does not require us to generate layouts just to answer a question of "is this type supported?".

Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:

  Add offset/size fields

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

Changes:
  - all: https://git.openjdk.org/jextract/pull/156/files
  - new: https://git.openjdk.org/jextract/pull/156/files/28fcda3d..6b06ec69

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jextract&pr=156&range=02
 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=156&range=01-02

  Stats: 43 lines in 3 files changed: 26 ins; 1 del; 16 mod
  Patch: https://git.openjdk.org/jextract/pull/156.diff
  Fetch: git fetch https://git.openjdk.org/jextract.git pull/156/head:pull/156

PR: https://git.openjdk.org/jextract/pull/156


More information about the jextract-dev mailing list