Age | Commit message (Collapse) | Author |
|
This isn't such a massive win as I'd have hoped, but it is consistently faster,
so there's no reason not to.
> ./bindgen-old tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2>&1
6.17s user 0.84s system 98% cpu 7.079 total
> ./target/release/bindgen tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2>
5.92s user 0.87s system 98% cpu 6.866 total
Which isn't _that_ much but it's quite a bit.
|
|
|
|
|
|
|
|
Warn about unused whitelist options
|
|
from it.
|
|
|
|
|
|
Given it was a considerable performance hit under some workloads.
Closes #1465.
|
|
Instead of converting all the tokens to utf-8 before-hand, which is costly, and
allocating a new vector unconditionally (on top of the one clang already
allocates), just do the tokenization more lazily.
There's actually only one place in the codebase which needs the utf-8 string,
all the others can just work with the byte slice from clang.
This should have no behavior change, other than be faster. In particular, this
halves the time on my machine spent on the test-case from #1465.
I'm not completely sure that this is going to be enough to make it acceptable,
but we should probably do it regardless.
|
|
The link to the user guide pointed to https://rust-lang-nursery.github.io/rust-bindgen/
|
|
The root cause of the issue was the missing:
```
self.saw_bindgen_union |= new.saw_bindgen_union;
```
But I also cleaned up a bit more and removed the unused saw_union.
Fixes #1457
|
|
|
|
|
|
comments.
|
|
I give up on the doc comments. This is a rebase of #1334 keeping the formatting
of the comments and using TokenStream::from_str instead because one can hope.
Fixes #1407.
|
|
Don't mangle using the parse callbacks for whitelisting / blacklisting / etc.
|
|
This allows for explicit selection of which traits are derived for a
type, e.g. deriving custom traits on particular types that need it.
Example usage:
```C++
/// <div rustbindgen derive="Clone"></div>
/// <div rustbindgen derive="MyDerivableTrait"></div>
struct foo { ... };
```
generates into
```Rust
#[derive(Clone,MyDerivableTrait)]
struct foo { ... }
```
|
|
|
|
|
|
There is no useful action to take on those, but receiving their values
(to re-export them as cfg() options) would be helpful right now in
integrating with RIOT's build system.
|
|
Fix noisy errors
This silences errors from template functions and dependant types.
|
|
This silences errors from template functions and dependant types.
|
|
|
|
Add item_name parse callback.
Issue: #428
|
|
|
|
|
|
Looks like the accepted argument has always been "functions", and this output has always been "function".
|
|
|
|
attribute(overloadable).
Fixes #1350
|
|
Fixes #1429.
|
|
|
|
|
|
(regardless of which sort of Item they are)
|
|
The previous PR ended up with a lot of just-called-once methods. Just inline
them since they're confusing otherwise.
Also avoid testing all the variants of an enum if there was a match already, or
if the enum is not anonymous. This is mostly a minor optimization.
|
|
|
|
Fixes #1412.
|
|
Since #1378 broke a bunch of OSX builds.
Most people don't care about them and they're in some OSX system headers which
means that this could break normal C and C++ stuff.
This introduces --generate-block / generate_block to generate these signatures,
and adds tests so that this is getting tested.
|
|
|
|
|
|
|
|
Clang doesn't allow `=` between `-x` and the language name.
|
|
Seems like a better fix, which allows us to preserve typedefs properly, and
also to find the calling convention.
Fixes #1402.
|
|
I just realized that we don't really check for this but that clang does.
|
|
|
|
|
|
PartialOrd and Ord for enum
Hello all,
This PR tries to fix #1395.
Many thanks for any comment.
|
|
|
|
Also adds a test header I missed from the previous PR.
Fixes #1393
|
|
To work-around some cases of https://github.com/rust-lang/rust/issues/54341.
Other cases where u128 and u64 are mixed in fields might not behave correctly,
but the field offset assertions would catch them.
Fixes #1370
|