Age | Commit message (Collapse) | Author |
|
Add support for the thiscall ABI
Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/541
The thiscall ABI is experimental, so in order to use it nightly is required and also the following statement:
`#![feature(abi_thiscall)]`
That's a problem because the `tests_expectations` crate (in the tests folder) tries to compile it (and stable is required).
|
|
Bitfields in unions
Fixes #744
I think it is WIP for the moment as I didn't run tests locally.
|
|
|
|
|
|
attribute
|
|
Also make impl_partialeq test to also cover impl_debug case.
|
|
|
|
Also clean a bit.
|
|
|
|
|
|
Remove derive-partialeq-template-inst test.
Add comments.
Don't implement PartialEq for incomplete arrays
Handle opaque bases and template instantiations
Extract constrain_type.
Extract `is whitelisted?` check
Add failing partialeq-anonfield
join for comps
Fix: return insert if not whitelisted
Delegate TypeRefs and alias to constrain_join.
Delegate Template instantiations to constrain_join
Add derive-partialeq-pointer.hpp test
Update comment.
Fix layout alignment larger that array limit
Add missing test for derive-partialeq-anonfield.rs
Clean
Clean
Fix typo in opaque-template-inst-member test
Remove redudant stmt
Add comment on can_supersede.
Format impl_partialeq and leave a comment
Extract requires_storage into it's own function.
Clean
|
|
|
|
And also allow ID comparison across ID types, as this makes implementing the
above much easier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This commit makes certain `TypeKind`s that can only reference other types use
`TypeId` instead of `ItemId`.
|
|
None of the callers were passing template parameters.
|
|
|
|
This commit also makes `BindgenContext::resolve_type` take a `TypeId`, and adds
unchecked conversions everywhere that we call it. Next, I'm going to go through
the code base, replacing these unchecked conversions with checked ones, and
tightening up types as I go.
|
|
|
|
Clean.
Add timer.
Clean codegen
|
|
Impl_debug fixes
r? @fitzgen
|
|
|
|
|
|
|
|
|
|
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
|
|
Also simplifies the logic that determines which enum variation gets chosen.
|
|
The latest `rustfmt` has fixed the formatting bugs we were running into.
|
|
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
|
|
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`
|
|
|
|
|
|
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
|
|
|
|
|
|
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
|
|
|
|
|
|
This fix creates a new private field with the required aligned size. This new
private field ensures that the union has the required size.
|
|
Instead of specifying whether or not to use stable, specify the Rust
release to support (one of several stable/beta releases or nightly).
The `--unstable-rust` option is still accepted and implies nightly.
The definitions of `RustTarget` and `RustFeatures` are created with
macros.
For each test that uses unions, there is a version that uses the latest
stable and 1.0.
This also fixes the bug where unions were generated with non-Copy
fields.
|
|
Implements Debug trait for types which do not support derive Debug
For types that do not support derive Debug be implemented automatically by rust,
we know can generate implementations of the Debug trait. This code generation is
hidden behind the '--force-derive-debug' command-line flag.
Should solve: #875
Sorry for the extra noise in lib.rs, codegen/mod.rs etc, that was rustfmt.
|