-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing LLVM Target Initialization APIs #935
Comments
Is there a reason why the |
Generally yeah, they're more than enough. I just noticed they were missing from the javacpp output and wanted to raise awareness. There would be some unnecessary initalization if one doesn't use all the targets, but it's a very minor thing. |
The problem isn't macro expansion, it's because JavaCPP doesn't process |
Released with version 1.5.4! Thank you for your contribution |
Partially related to #932
In the
llvm-c/Target.h
header there are six macros which declare functions for target initialization. These are ran for each target to generate a set of APIs exposed to LLVM-C.Javacpp is currently not properly read though this (probably because the
llvm/Config/Targets.def
file is created during build generation.Fix
I'm not sure how we want to go about adding these APIs as they should only be available if the target is enabled. With the current build setup, that would be one target, but a different one for each platform we build the binaries for.
Creating a stub file (similar to LLVM full optimization #869) in the resources directory and add it to the preset for ALL targets
This solution means that the initialization API for every target will be "available" regardless of which target the user's binary has enabled. This is probably not wanted behavior because calling into a function which doesn't actually exist will crash the JVM.
Parse the
llvm-c/Target.h
file after build generator step, assuming the Javacpp parser is able to perform macro expansion.This requires the parser to go over the files after the build has been generated.
I have created an example showing how this could be done if we go with option 1 here
The text was updated successfully, but these errors were encountered: