RFR: 7903672: Some issues with missing dependency errors

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Feb 19 15:28:06 UTC 2024


On Sat, 17 Feb 2024 16:39:53 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> - Only error on missing dependencies, if the dependent is not skipped
> - Scan element types of arrays for missing dependencies as well
> - Don't issue warnings about unsupported types/fields for skipped elements
> 
> I've pulled the code that issues errors for missing dependencies into a separate phase (`MissingDepWarner`), since the control flow in some of the visitor methods was kinda tricky to follow if this stayed mixed in with the `IncludeFilter` code. The new phase just cleanly checks whether the visited element has a `Skip` on it and then returns at the start, before doing any work.
> 
> I've also re-ordered the phases a bit so that the phases that add Skips run first, so that we don't issue warnings/errors for things that are skipped any way by a later phase. Since `UnsupportedFilter` both adds Skips and issues warnings, it sits right in the middle.
> 
> Q: should we also return early in `NameMangler` if an element is skipped? (Right now it's just doing extra work).

src/main/java/org/openjdk/jextract/impl/MissingDepWarner.java line 35:

> 33:  * This visitor marks declarations to be skipped, based on --include options specified.
> 34:  */
> 35: public final class MissingDepWarner implements Declaration.Visitor<Void, Declaration> {

We should probably call this `MissingDepChecker` - given we give errors, not warnings (similar comment applies to the `warnMissingDeps` method)

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

PR Review Comment: https://git.openjdk.org/jextract/pull/217#discussion_r1494722236


More information about the jextract-dev mailing list