Age | Commit message (Collapse) | Author |
|
Move bitfields into the IR
This PR moves bitfields and the computation of their allocation units into the IR. They were previously computed on-the-fly during code generation. In addition to breaking up and compartmentalizing a portion of the gargantuan `CodeGeneration` implementation for `CompInfo`, this paves the way for adding const-fn bitfield unit constructors.
Also some improvements to `tests/test-one.sh`.
Also some graphviz output improvements that got tangled up in the last commit without a good way to pull them out into their own commit (sorry).
r? @emilio
|
|
|
|
This commit moves bitfields and the computation of their allocation units into
the IR. They were previously computed on-the-fly during code generation. In
addition to breaking up and compartmentalizaing a portion of the gargantuan
`CodeGeneration` implementation for `CompInfo`, this paves the way for adding
const-fn bitfield unit constructors.
|
|
|
|
Bump clang-sys version to 0.18.0
This update improves detection of versioned instances of `libclang.so` (e.g., `libclang.so.3.9`).
See [here](https://github.com/KyleMayes/clang-sys/tree/db88aea22b3ad67020fab331b42ddc071e598c8c#dependencies) for information on which instance is selected when there are more than one to choose from.
Thanks to @semarie for a pull request implementing this.
|
|
|
|
Allow running tests that don't have `bindgen-flags` pragmas. Less noisy
output. Show diff if the generated bindings differ from the expected bindings.
|
|
Fix issue template typo
Small typo fix
|
|
|
|
Add other bitwise ops for bitflag enums
Currently, bitflag enums only implement `BitOr`. However, it is fairly common to `&` bitflags, requiring the `BitAnd` trait to be implemented as well. I also implemented `BitOrAssign` and `BitAndAssign` in the process.
|
|
|
|
ir: Handle properly template alias instantiations in clang >3.9
|
|
ir: Handle default template parameters in libclang >3.9.
Fixes #585
|
|
This fixes tests/expectations/tests/type_alias_template_specialized.rs in those
clang versions (without regressions, hopefully), and makes the behavior the
proper one, without needing replacements.
|
|
Fixes #585
|
|
codegen: Make phantom fields public.
Otherwise you can't construct structs outside of the bindings file, which is
breaking.
Also, given the previous change was breaking and I didn't notice, I yanked
0.24.1.
|
|
Otherwise you can't construct structs outside of the bindings file, which is
breaking.
Also, given the previous change was breaking and I didn't notice, I yanked
0.24.1.
|
|
ir: Don't assume template instantiation argument with vtable implies vtable
Fixes #691
|
|
|
|
|
|
Bump clang-sys to 0.17.0
It turns out that some versions of Clang don't have `#include <...> search starts here:` in their output (KyleMayes/clang-sys#54).
I changed the storage type of the include search paths in `clang-sys` from `Vec<PathBuf>` to `Option<Vec<PathBuf>>` to reflect the possibility that finding and parsing the include search paths might fail.
|
|
|
|
Emit `PhantomData<UnsafeCell<T>>` members for all generic parameters
This makes generated generic structs lifetime invariant, since we cannot know
the C++ type's true variance.
Fixes #506
Rebased + squashed version of #635; cc @Kowasaki
To resolve the conflicts and rebase and squash, I did essentially these commands:
```
$ git fetch servo
$ git checkout -b Kowasaki-master servo/master
$ git merge --squash --edit Kowasaki/master
$ cargo test
$ cd tests/expectations
$ cargo test
$ cd -
$ git commit --author="Kowasaki"
$ git push fitzgen Kowasaki-master
```
Hopefully that is useful for you in the future :) Thanks for fixing this issue!
|
|
This makes generated generic structs lifetime invariant, since we cannot know
the C++ type's true variance.
Fixes #506
|
|
Breaking version bump.
After all the huge work @fitzgen has been doing diagnosing stylo issues, we seem ready to try again!
Also, a lot of issues have been fixed lately.
|
|
|
|
objc: Fixes to properly parse most of Foundation
I had half of these just lying around in my commit queue for a while, having problems with the template param thing. Incidentally, either some other fixes made it work, or I had accidentally built against clang 4.0, which I guess doesn't work with the current approach.
With these I'm able to parse and generate code for Foundation.framework, with regex ^NS.* (and skipping that one id redefine). Also needed --no-doc-comments, that I guess generated comment for an enum in the wrong place, didn't look at that.
|
|
Kill serde_json dependency
This bumps the dependency clang-sys from 0.15.2 to 0.16.0. It removes some heavy dependencies from the tree, notably serde_json.
This resolves issue #499.
|
|
|
|
|
|
Prefixes the clashing class method with class_ prefix
|
|
While parsing a Objective C property with function pointer type, bindgen hanged and died.
This is still not generating valid code function signature for the property, but at least it is not dying.
The actual fix was proposed by emilio.
|
|
The objetive-c template type params were handled as Typedefs so every
interface generated its own, clashing in the namespace. This now maps them to id.
|
|
Bump the required clang-sys version to 0.15.2
Better fix for #671 for downstream crates.
r? @upsuper or @emilio
|
|
Better fix for #671 for downstream crates.
|
|
Generate bindings to all headers passed to `Builder::header`
Inspired by real misconfiguration from inside stylo.
The previous behavior was that it would reconfigure the builder to generate
bindings to the last header `Builder::header` was invoked with. This was not
what people would expect: they expected it to generate bindings for all of the
headers, and were accidentally misconfiguring their builders.
This is a breaking change, but moves us inline with users' expectations.
r? @emilio
|
|
ir: Support nested namespace specifiers.
Fixes #677
|
|
Remove rustc-serialize dependency.
Fixes #659
|
|
The previous behavior was that it would reconfigure the builder to generate
bindings to the last header `Builder::header` was invoked with. This was not
what people would expect: they expected it to generate bindings for all of the
headers, and were accidentally misconfiguring their builders.
This is a breaking change, but moves us inline with users' expectations.
|
|
|
|
Fixes #659
|
|
Update ISSUE_TEMPLATE.md
Adds `<details>` (which github will make hidden by default, but is expandable) around the logs section.
A few minor other tweaks.
r? @emilio
|
|
Adds `<details>` (which github will make hidden by default, but is expandable) around the logs section.
A few minor other tweaks.
|
|
Trace opaque types' template parameters and inner types
The template parameter usage analysis needs to see the template parameters'
definitions and have edges from any inner type to the parent in order to
propagate data flow through dependencies properly.
Fixes #674
r? @emilio
|
|
Update dependencies
Ran `cargo update`. This gets us clang-sys version 0.15.2, which contains some
fixes for finding the appropriate libclang.so.
Fixes #671
r? @emilio or @cpeterso or @upsuper or anyone who wants to...
|
|
The template parameter usage analysis needs to see the template parameters'
definitions and have edges from any inner type to the parent in order to
propagate data flow through dependencies properly.
Fixes #674
|
|
Ran `cargo update`. This gets us clang-sys version 0.15.2, which contains some
fixes for finding the appropriate libclang.so.
Fixes #671
|
|
Clarify wording of command line help
I tried to make the wording more consistent and easier to read.
|
|
|
|
Add the `bindgen` Users Guide
This commit adds a Users Guide, built with [mdbook][] (the same tool used
by *The Rust Book*).
It moves all the user documentation from the README.md into the Users Guide. It
leaves the README.md as a splash page featuring an example of what `bindgen` is
and does, a link to the Users Guide, a link to the docs.rs/bindgen API reference
documentation, and a link to CONTRIBUTING.md.
It ensures that the Users Guide builds with `mdbook`, and all code snippets
within it build as doctests and pass, on every CI run.
Finally, it builds and uploads the Users Guide every time CI passes on the
master branch.
[mdbook]: https://github.com/azerupi/mdBook
r? @emilio see the rendered book here: https://servo.github.io/rust-bindgen/index.html
|