RFR: Refresh libclang
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Dec 19 11:40:30 UTC 2023
On Tue, 19 Dec 2023 11:34:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> Following the latest jextract changes, it is now time to refresh the libclang classes used by jextract. As a result, this change will drop `RuntimeHelper` and all constant classes (as the new generation strategy no longer needs them).
>
> I encountered a couple of issues when running the updating script, which prompted me to simplify the script, and to add some more documentation.
updateclang/clang.symbols line 19:
> 17: --include-typedef CXCursorVisitor
> 18: --include-typedef CXIndex
> 19: --include-typedef CXSourceRange
Interesting side-effect of the new translation strategy: since struct A depends on struct B in its layout, if you need to generate A now you also need to generate B. Otherwise the generated code will have an unresolved reference to B from A's layout.
updateclang/extract.sh line 3:
> 1: #!/bin/bash
> 2:
> 3: echo "Extracting libclang headers..."
I've added these output strings so that it's possible to see what's going on
updateclang/extract.sh line 16:
> 14:
> 15: for x in ../src/main/java/org/openjdk/jextract/clang/libclang/*.java; do
> 16: (cat cp_header.txt; echo; cat $x) > /tmp/file;
on my machine, the script hang here. In reality we don't need this complex logic, so I've tweaked the instructions so that the libclang folder is always deleted first (this would also ensure that there's no files leftover from previous runs).
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/168#discussion_r1431290357
PR Review Comment: https://git.openjdk.org/jextract/pull/168#discussion_r1431288136
PR Review Comment: https://git.openjdk.org/jextract/pull/168#discussion_r1431289072
More information about the jextract-dev
mailing list