-
Notifications
You must be signed in to change notification settings - Fork 7
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
Only output types and methods from the original header #13
Comments
Depends on the IR work done in #6 |
@jonas, should we remove unused types and structs that are declared only in included headers or all unused types and structs? I wrote code that removes unused types in filter-unused-types branch but it is not aware from where these types came from |
Depends on type representation in the IR: #52 |
How do we decide that type may be removed? |
This issue can be repurposed as an initial step towards #2. We need to track which header file declared a type and based on that we can prune (or ignore) any type not declared in the header file for which we are generating bindings. Note that eventually we need to support generating bindings for multiple header files. |
I've retitled the issue based on the above comment. |
From looking into this, it should be possible to use Methods not in the original header can be discarded right away, while types will have to be added to the IR in case we have to reference it, e.g. On macOS I noticed that some standard headers are merely wrappers, e.g. |
I'm also wondering if we should put in place a proper class to track the origin of a declaration. The class should contain:
|
In the
native types
test both theuchar.h
andstddef.h
header files are included which depending on the platform will generate additional type aliases and structs definitions for types read from those headers even if those types are unused.The text was updated successfully, but these errors were encountered: