RFR: 7903198: Refine filtering for enums
Athijegannathan Sundararajan
sundar at openjdk.java.net
Wed May 25 08:08:13 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.
LGTM
-------------
Marked as reviewed by sundar (no project role).
PR: https://git.openjdk.java.net/jextract/pull/36
More information about the jextract-dev
mailing list