Age | Commit message (Collapse) | Author |
|
|
|
Also simplifies the logic that determines which enum variation gets chosen.
|
|
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
|
|
|
|
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).
|
|
|
|
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
|
|
|
|
|
|
Fixes #942
Fixes #947
|
|
Presumably they are blacklisted because we can't understand them properly, so be
pessimistic about what we can derive for it.
Fixes #944.
|
|
|
|
we parse it.
This ensures that we see all the relevant types that are defined when parsing
the definition, avoiding problems like #888.
Fixes #888
|
|
initial timer branch commit
added time_phases builder parameter
create timers for BindgenContex analyses, codegen
time parse
added docstrings
added fitzgens suggestions
add --time-phases to bindgen::Builder::command_line_flags
|
|
Avoid generating fields/methods for opaque objects
WIP fix for issue #929
With libclang 4, passes all tests on my machine except `dump_preprocessed_input`, but that fails on the master branch as well
|
|
|
|
|
|
Rewrite `has destructor` analysis as a fixed-point analysis
Fixes #927 . Note that this creates a dependency between the "cannot derive copy" and "has destructor" analysis, i.e. the "has destructor" analysis must run before the "cannot derive copy" analysis, because "cannot derive copy" needs the results of "has destructor".
|
|
monotone framework
|
|
Thanks @fitzgen for the detailed instructions.
Fixes #928.
|
|
|
|
Also renames a bunch of other things referring to named types to refer to type
parameters.
Fixes #915
|
|
Addresses #832
|
|
Fix misleading comments
r? @fitzgen or @emilio
|
|
|
|
Older clang don't have it, and while we can't pass our whole test suite with
those older clangs, we can still generate simple C bindings, so it makes sense
not to panic for C++ only things.
|
|
If we aren't going to derive `PartialEq`, then it doesn't make sense to even run
the analysis.
|
|
Only run analyses when we are going to use their results
Currently, there are various analyses related to deriving various traits that we unconditionally run. However, if we aren't going to derive those traits in codegen, then computing whether or not we can derive the traits is wasteful.
r? @emilio
|
|
Currently, there are various analyses related to deriving various traits that we
unconditionally run. However, if we aren't going to derive those traits in
codegen, then computing whether or not we can derive the traits is wasteful.
|
|
|
|
|
|
|
|
The --rustfmt-configuration-file command-line argument automatically activates --rustfmt-bindings.
|
|
|
|
This patch enables bindgen to run rustfmt on generated bindings. Rustfmt is used
from the global PATH. Two new command-line arguments are added:
1. --format-bindings: Enables running rustfmt
2. --format-configuration-file: The configuration file for rustfmt (not required).
|
|
Fixes alignment errors with new Rust union type
This fix creates a new private field with the required aligned size. This new
private field ensures that the union has the required size.
This fixes: #908
|
|
This fix creates a new private field with the required aligned size. This new
private field ensures that the union has the required size.
|
|
Stablize name of reference and nested combination of ref, ptr, and array
|
|
|