summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-05-18Auto merge of #704 - fitzgen:bitfields-into-ir, r=emiliobors-servo
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
2017-05-18Run tests with RUST_BACKTRACE=1Nick Fitzgerald
2017-05-18Move bitfields into the IRNick Fitzgerald
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.
2017-05-17Use the default test flags in test-one.shNick Fitzgerald
2017-05-17Auto merge of #703 - KyleMayes:clang-sys, r=emiliobors-servo
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.
2017-05-17Bump clang-sys version to 0.18.0Kyle Mayes
2017-05-17Small improvements to test-one.shNick Fitzgerald
Allow running tests that don't have `bindgen-flags` pragmas. Less noisy output. Show diff if the generated bindings differ from the expected bindings.
2017-05-12Auto merge of #700 - tmfink:template-typo, r=emiliobors-servo
Fix issue template typo Small typo fix
2017-05-12Fix issue template typoTravis Finkenauer
2017-05-11Auto merge of #698 - jonhoo:more-bitops, r=fitzgenbors-servo
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.
2017-05-10Add other bitwise ops for bitflag enumsJon Gjengset
2017-05-10Auto merge of #696 - emilio:template-alias-inst, r=fitzgenbors-servo
ir: Handle properly template alias instantiations in clang >3.9
2017-05-10Auto merge of #694 - emilio:finally, r=fitzgenbors-servo
ir: Handle default template parameters in libclang >3.9. Fixes #585
2017-05-10ir: Handle properly template alias instantiations in clang >3.9.Emilio Cobos Álvarez
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.
2017-05-10ir: Handle default template parameters in libclang >3.9.Emilio Cobos Álvarez
Fixes #585
2017-05-08Auto merge of #693 - emilio:pub-phantom, r=fitzgenbors-servo
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.
2017-05-08codegen: Make phantom fields public.v0.25.0Emilio Cobos Álvarez
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.
2017-05-08Auto merge of #692 - emilio:virtual-template-params, r=fitzgenv0.24.1bors-servo
ir: Don't assume template instantiation argument with vtable implies vtable Fixes #691
2017-05-08Bump version.Emilio Cobos Álvarez
2017-05-08ir: Don't assume template instantiation argument with vtable implies vtable.Emilio Cobos Álvarez
2017-05-08Auto merge of #690 - KyleMayes:clang-sys, r=fitzgenbors-servo
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.
2017-05-08Bump clang-sys to 0.17.0Kyle Mayes
2017-05-05Auto merge of #689 - fitzgen:Kowasaki-master, r=fitzgenbors-servo
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!
2017-05-05Emit `PhantomData<UnsafeCell<T>>` members for all generic parametersKowasaki
This makes generated generic structs lifetime invariant, since we cannot know the C++ type's true variance. Fixes #506
2017-05-03Auto merge of #686 - emilio:bump, r=fitzgenv0.24.0bors-servo
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.
2017-05-03Breaking version bump.Emilio Cobos Álvarez
2017-05-03Auto merge of #673 - scoopr:objc, r=emiliobors-servo
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.
2017-05-03Auto merge of #685 - TannerRogalsky:bump_clang_sys, r=emiliobors-servo
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.
2017-05-03bump clang-sys from 0.15.2 to 0.16.0Tanner Rogalsky
2017-05-03objc: Fix broken option handlingMikko Lehtonen
2017-05-03objc: Handle class and instance method with same nameMikko Lehtonen
Prefixes the clashing class method with class_ prefix
2017-05-03objc: Fix infinite recursionMikko Lehtonen
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.
2017-05-03objc: Handle template paramsMikko Lehtonen
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.
2017-05-01Auto merge of #682 - fitzgen:bump-clang-sys-version, r=upsuperbors-servo
Bump the required clang-sys version to 0.15.2 Better fix for #671 for downstream crates. r? @upsuper or @emilio
2017-05-01Bump the required clang-sys version to 0.15.2Nick Fitzgerald
Better fix for #671 for downstream crates.
2017-05-01Auto merge of #681 - fitzgen:allow-multiple-headers, r=emiliobors-servo
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
2017-05-01Auto merge of #680 - emilio:nested-ns, r=fitzgenbors-servo
ir: Support nested namespace specifiers. Fixes #677
2017-05-01Auto merge of #679 - emilio:ser, r=fitzgenbors-servo
Remove rustc-serialize dependency. Fixes #659
2017-05-01Generate bindings to all headers passed to `Builder::header`Nick Fitzgerald
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.
2017-05-01ir: Support nested namespace specifiers.Emilio Cobos Álvarez
2017-05-01Remove rustc-serialize dependency.Emilio Cobos Álvarez
Fixes #659
2017-05-01Auto merge of #678 - servo:fitzgen-patch-1, r=emiliobors-servo
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
2017-05-01Update ISSUE_TEMPLATE.mdNick Fitzgerald
Adds `<details>` (which github will make hidden by default, but is expandable) around the logs section. A few minor other tweaks.
2017-05-01Auto merge of #675 - fitzgen:issue-674-stylo-template-parameters, r=emiliobors-servo
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
2017-05-01Auto merge of #676 - fitzgen:update-clang-sys, r=emiliobors-servo
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...
2017-05-01Trace opaque types' template parameters and inner typesNick Fitzgerald
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
2017-05-01Update dependenciesNick Fitzgerald
Ran `cargo update`. This gets us clang-sys version 0.15.2, which contains some fixes for finding the appropriate libclang.so. Fixes #671
2017-04-28Auto merge of #670 - tmfink:doc-fix, r=emiliobors-servo
Clarify wording of command line help I tried to make the wording more consistent and easier to read.
2017-04-28Clarify wording of command line helpTravis Finkenauer
2017-04-26Auto merge of #668 - fitzgen:users-guide, r=emiliobors-servo
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