[foreign] jextract does not filter typedefs, enums, and structs

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Wed Jan 16 04:16:00 UTC 2019


Unlike function symbols, we can't just filter symbols. We've to 
carefully walk the dependencies of exported functions (all types 
directly/indirectly used from parameter and return types have to be 
included). In theory, it should be possible to generate only transitive 
closure of types needed for the included symbols. As you've found it 
already, there is a bug filed for that.

-Sundar

On 15/01/19, 10:42 PM, Jorn Vernee wrote:
> Hello,
>
> Now that I'm done with the initial Windows support I have started 
> looking for interesting Windows APIs to create tests/demos with. 
> Pretty much any part of the Windows API requires users to include 
> Windows.h, which is a huge header that pretty much includes everything 
> and currently requires 14GB of RAM to extract. Trying to jextract a 
> sub-header breaks the pre-processor code in those headers.
>
> So, I'm using `--include-symbols` to select just the things I need, 
> but I find TreeFilter [1] lacks filtering of typedefs, structs, and 
> enums. So a lot of unneeded classes are still being generated. Why are 
> these Tree types not currently filtered?
>
> Thanks,
> Jorn
>
> [1] : 
> http://hg.openjdk.java.net/panama/dev/file/d7885ab60131/src/jdk.jextract/share/classes/com/sun/tools/jextract/TreeFilter.java


More information about the panama-dev mailing list