Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Make BindgenOptions private
Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/958
r? @fitzgen
|
|
|
|
Depreciate `Builder::whitelisted_type`.
Closes #987
Also, we were making a call to the now deprecated `Builder::hide_type`,
changed that over to call `Builder::blacklist_type.
|
|
Update to reference `whitelist_type` function.
|
|
Closes #987
Also, we were making a call to the now deprecated `Builder::hide_type`,
changed that over to call `Builder::blacklist_type.
|
|
Add a `Builder::blacklist_type`
This deprecates `Builder::hide_type`.
Related to #984.
- [x] Add Builder::blacklist_type, that does the same thing as hide_type
- [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"]
- [x] Make hide_type delegate to blacklist_type
- [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types
- [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name
- [x] Rename ir::item::Item::is_hidden to is_blacklisted
r? @fitzgen
|
|
Depreciate whitelisted function.
Closes #985
I also noticed a reference to `whitelisted_function` within the book, should this be updated as well?
https://github.com/rust-lang-nursery/rust-bindgen/blob/a371de097f5e37eb01754525fb1e2029ca88b0be/book/src/whitelisting.md
I've started to learn rust recently, so please let me know if there is anything I missed.
|
|
This deprecates `Builder::hide_type`.
Related to #984.
- [x] Add Builder::blacklist_type, that does the same thing as hide_type
- [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"]
- [x] Make hide_type delegate to blacklist_type
- [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types
- [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name
- [x] Rename ir::item::Item::is_hidden to is_blacklisted
|
|
Closes #985
|
|
Make whitelisted_var consistant with CLI flags
Closes #986
This is my first time contributing to rust so hopefully I did everything right, otherwise let me know.
|
|
|
|
Add an architectural overview of `bindgen` to CONTRIBUTING.md
This should help new contributors who are coming to the code base for the first time get up and running.
r? @emilio
|
|
This should help new contributors who are coming to the code base for the first
time get up and running.
|
|
Generate constants for enums by default
Closes #758.
The first commit does strictly what the issue description described, the second does a small amount of (what I believe is) logic simplification.
Hopefully I didn't miss any tests when adding the `--rustified-enum .*` flag to the ones that needed it; all of the tests are passing for me, though, so I don't think I did.
|
|
Also simplifies the logic that determines which enum variation gets chosen.
|
|
Add a link to issues labeled "help wanted" to CONTRIBUTING.md
|
|
|
|
fitzgen:document-no-recursive-whitelist-will-break-code, r=emilio
Document that not recursively whitelisting is dangerous
See #949 for context and motivation.
r? @emilio
|
|
No more syntex
There are a few commits in this PR, but the big one is the commit that goes `syntex` -> `quote` for code generation. I've included a copy of its commit message below.
I tried to verify that it works with the stylo build still, but there were some issues, and then I checked with master, and that wasn't working either. So now I'm C-Reducing the failures on master and figured that this is at least ready for feedback in the meantime.
r? @emilio
----------------------------
The `syntex` crate is unmaintained. It is slow to build, and additionally it requires that we pre-process `src/codegen/mod.rs` before we build the `bindgen` crate.
The `quote` crate provides similar quasi-quoting functionality, is maintained, and builds faster. It doesn't have a typed API or builders, however; it only deals with tokens.
Before this commit:
```
$ cargo clean; cargo build
<snip>
Finished dev [unoptimized + debuginfo] target(s) in 98.75 secs
```
After this commit:
```
$ cargo clean; cargo build
<snip>
Finished dev [unoptimized + debuginfo] target(s) in 46.26 secs
```
Build time is cut in half! But what about run time?
Before this commit:
```
Generated Stylo bindings in: Duration { secs: 3, nanos: 521105668 }
```
After this commit:
```
Generated Stylo bindings in: Duration { secs: 3, nanos: 548797242 }
```
So it appears to be about 20ms slower at generating Stylo bindings, but I suspect this is well within the noise.
Finally, this also lets us remove that nasty `mem::transmute` inside `bindgen::ir::BindgenContext::gen` that was used for the old `syntex` context. Now `BindgenContext` doesn't have a lifetime parameter either. This should make it easier to revisit doing our analyses in parallel with `rayon`, since that context was one of the things that made it hard for `BindgenContext` to implement `Sync`.
Fixes #925
|
|
|
|
LD_LIBRARY_PATH is unnecessary; LIBCLANG_PATH is enough
r? @emilio
|
|
|
|
|
|
The latest `rustfmt` has fixed the formatting bugs we were running into.
|
|
|
|
|
|
|
|
|
|
;)
|
|
Was previously printing seconds, but claiming it was milliseconds.
|
|
|
|
The `syntex` crate is unmaintained. It is slow to build, and additionally it
requires that we pre-process `src/codegen/mod.rs` before we build the `bindgen`
crate.
The `quote` crate provides similar quasi-quoting functionality, is maintained,
and builds faster. It doesn't have a typed API or builders, however; it only
deals with tokens.
Before this commit:
```
$ cargo clean; cargo build
<snip>
Finished dev [unoptimized + debuginfo] target(s) in 98.75 secs
```
After this commit:
```
$ cargo clean; cargo build
<snip>
Finished dev [unoptimized + debuginfo] target(s) in 46.26 secs
```
Build time is cut in half! But what about run time?
Before this commit:
```
Generated Stylo bindings in: Duration { secs: 3, nanos: 521105668 }
```
After this commit:
```
Generated Stylo bindings in: Duration { secs: 3, nanos: 548797242 }
```
So it appears to be about 20ms slower at generating Stylo bindings, but I
suspect this is well within the noise.
Finally, this also lets us remove that nasty `mem::transmute` inside
`bindgen::ir::BindgenContext::gen` that was used for the old `syntex`
context. Now `BindgenContext` doesn't have a lifetime parameter either. This
should make it easier to revisit doing our analyses in parallel with `rayon`,
since that context was one of the things that made it hard for `BindgenContext`
to implement `Sync`.
Fixes #925
|
|
|
|
|
|
See #949 for context and motivation.
|
|
Derive + blacklisted types
* [X] document blacklisting + derive interaction
* [X] derive `Copy`
* [X] derive `Debug`
* [X] `--impl-debug`
* [x] derive `Default`
* [x] derive `Hash`
* [x] derive `PartialEq`
|
|
Unions don't support deriving these things, even if there is only one
variant (the opaque layout field).
|
|
|
|
We already have a test for more complicated template instantiations and
blacklisting and their affects on deriving `Hash`, but it is good to have sanity
tests for the simple cases too.
|
|
|
|
This makes it so that whitelisted items and edges outgoing from them are black,
while non-whitelisted items and their edges are gray.
|
|
|
|
|
|
Add `bindgen::Builder::derive_copy`
Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/948
|
|
|
|
ir: Pass the target to clang if it wasn't explicitly passed already.
Fixes #942
Fixes #947
|
|
|