-
Notifications
You must be signed in to change notification settings - Fork 746
Generate extern wrappers for inlined functions #2335
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
Merged
pvdrz
merged 37 commits into
rust-lang:main
from
ferrous-systems:generate-inline-functions
Feb 7, 2023
Merged
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
afbc4d8
Generate extern wrappers for inlined functions
pvdrz ad0f161
add(static inlined): tests
amanjeev 101cde0
add the `experimental` feature
pvdrz 61b2b44
Rename options
pvdrz 65a80e0
Fixup: Rename options
pvdrz eb823b8
merge filename and directory arguments
pvdrz 8b0bdcd
avoid second run
pvdrz 39ac21b
move all c serialization to codegen
pvdrz fa47c2b
some nits
pvdrz e33237b
update docs and remove headers
pvdrz d65527f
keep code serialization in the happy path
pvdrz c80ed2d
rename `non-extern` to `static`
pvdrz 9ecbde4
Remove headers
pvdrz 34278f4
update integration tests
pvdrz eb2a3d3
run rustfmt
pvdrz 595ce78
add experimental feature to dependency
pvdrz cb93924
use static kind
pvdrz e36e088
force function names
pvdrz ceebca1
refactor c serialization
pvdrz f7df058
add types for serialized functions and support pointer types
pvdrz c55aa5b
buffer all the code before writing
pvdrz c12645f
stop bindgen if there's a serialization error
pvdrz 3eb7f69
add missing space
pvdrz b682c6c
track location while reporting errors
pvdrz 6721b96
fix test
pvdrz ab6ea25
add support for Comp types
pvdrz bc7f6bf
run rustfmt
pvdrz e823b32
support `char`
pvdrz 0aafbee
add `Extra` associated type
pvdrz 58f740d
add proper support for functions
pvdrz affcb2f
fix tests and remove dbg
pvdrz 4819ea4
run rustfmt
pvdrz 7b8fe72
handle type aliases
pvdrz 7698c71
handle constness
pvdrz 9326863
use void for empty args
pvdrz 5a9e5ca
pass amanfmt :trollface:
pvdrz 572d1a4
some nits
pvdrz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
bindgen-tests/tests/expectations/tests/generate-extern-functions.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Generated C, C++, Header files | ||
|
||
This directory contains files for features where extra files are generated | ||
as a part of the feature. For example, `--generated-extern-functions`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
int foo__extern() { return foo(); } | ||
int bar__extern() { return bar(); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
int foo__extern(); | ||
int bar__extern(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// bindgen-flags: --experimental --generate-extern-functions | ||
|
||
static inline int foo() { | ||
return 11; | ||
} | ||
static int bar() { | ||
return 1; | ||
} | ||
inline int baz() { | ||
return 2; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.