Age | Commit message (Collapse) | Author |
|
This makes us not unnecessarily add repr(align) to unions.
Closes #1498.
|
|
Closes #1529.
|
|
This fixes a crash when using non-deductible auto types.
|
|
|
|
Fixes #1514
|
|
This fixes the issue seen in #1500 where function
pointers as a return type have their parameters incorrectly generated.
This also fixes a broken test case, objc_property_fnptr, as its types
are now generated correctly.
|
|
|
|
Prior to this change bindgen would simply print any error that occurred
while attempting to run rustfmt straight to stderr using fmt::Debug.
Combined with the fact that rustfmt is enabled by default now this meant that
if rustfmt was missing or not working a cryptic error would be printed.
|
|
I noticed that a `#pragma packed` class that has only a vtable but no
data members is not marked repr(packed). The bug is that is_packed
examines data members but not the vtable when applying its heuristic.
|
|
|
|
Fixes https://github.com/rust-lang/rust-bindgen/issues/537.
|
|
Fixes https://github.com/rust-lang/rust-bindgen/issues/1474.
|
|
Fixes https://github.com/rust-lang/rust-bindgen/issues/1480
|
|
|
|
Some perf tweaks
|
|
Fixes #684
|
|
This fixes a panic uncovered by the proc_macro update, which validates idents
now. We were using it as a pretty crappy way to turn it into something that
could be turned into a TokenStream. But TokenStream implements FromStr now.
|
|
|
|
This should allow making it a HashSet.
|
|
We use sequential id's so a Vec<Option<T>> does the trick.
This reduces the time for:
time ./target/release/bindgen tests/stylo.hpp --no-rustfmt-bindings
From ~6s to less than 5s on my machine.
|
|
This wins between 2 and 5 milliseconds more in the test-case above, so no reason
not to I guess.
|
|
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".
|
|
|