Integrated: 7903198: Refine filtering for enums

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed May 25 09:03:16 UTC 2022


On Fri, 20 May 2022 17:52:55 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch fixes an issue with the logic for filtering constants.
> Since both enum constants and `#define` macros are represented as `Declaration.Constant` nodes, `OutputFactory` is confused as to whether the constant being generated is a macro or not.
> 
> This patch adds a new filtering option `--include-enum`; this option can be used to include an enum (and all its constants). `OutputFactory` has been rectified so that:
> * `IncludeHelper` is also called on the enum (so that filtering happens)
> * `visitConstant` does not call `IncludingHelper` filtering routine on things that are non toplevel constants
> 
> In other words, if we get to `visitConstant` and the parent node is an enum - we should not filter: if we're here it means that the parent enum is included in the filtering.

This pull request has now been integrated.

Changeset: c2f1359c
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/jextract/commit/c2f1359c46728e3787bf0b0316c8078edd63ff7b
Stats:     46 lines in 6 files changed: 24 ins; 4 del; 18 mod

7903198: Refine filtering for enums

Reviewed-by: sundar

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

PR: https://git.openjdk.java.net/jextract/pull/36


More information about the jextract-dev mailing list