summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-04Minor version bump to grab clang-sys bump.Emilio Cobos Álvarez
2017-07-04Auto merge of #781 - shinglyu:linux32, r=emiliobors-servo
Passing additional clang arguments for Linux 32 cross compiling This is for https://bugzilla.mozilla.org/show_bug.cgi?id=1366050 But it has to wait for https://github.com/KyleMayes/clang-sys/pull/57 to land and version number bumped. (I'm making up the new version numbers for now.) r? @emilio
2017-07-04Passing additional clang arguments for Linux 32 cross compilingShing Lyu
2017-06-30Auto merge of #782 - SirVer:00_fix_repetition_operation, r=fitzgenbors-servo
Fix tests/test-one.sh. On Mac OS where egrep is != GNU grep, the script fails with ~~~ egrep: repetition-operator operand invalid ERROR: no files found with pattern "virtual_inheritance" ~~~~ The `$pattern` is supposed to be a substring in the test name to run. The leading and trailing stars are wrong, since egrep takes a regular expression, not a glob.
2017-06-30Fix tests/test-one.sh.Holger Rapp
On Mac OS where egrep is != GNU grep, the script fails with ~~~ egrep: repetition-operator operand invalid ERROR: no files found with pattern "virtual_inheritance" ~~~~ The `$pattern` is supposed to be a substring in the test name to run. The leading and trailing stars are wrong, since egrep takes a regular expression, not a glob.
2017-06-29Auto merge of #780 - rillian:llvm4, r=emiliobors-servo
Drop llvm@3.9 versioning for homebrew. Homebrew now defaults to llvm 4.0.x so there's no need to specify a specific version to get compatibility, unless we specifically want people using 3.9.
2017-06-29Drop llvm@3.9 versioning for homebrew.Ralph Giles
Homebrew now defaults to llvm 4.0.x so there's no need to specify a specific version to get compatibility.
2017-06-23Auto merge of #776 - snipsco:fix/ios-mangling, r=emiliobors-servo
Fix iOS mangling Hi, We had a regression on a project that target iOS while upgrading bindgen from `0.25.3` to `0.25.4`. After a long investigation it appeared that iOS need also a mangling hack. I managed to make a patch and successfully test it. Thanks a lot for all your work. Cheers
2017-06-23Add mangling hack for iosKevin Lefevre
2017-06-22Auto merge of #773 - fitzgen:allow-making-particular-instantiations-opaque, ↵bors-servo
r=emilio Allow marking specific template instantiations as opaque If a template has a specialization that bindgen doesn't understand, it can be helpful to mark it as opaque and continue making forward progress in the meantime. This is something we need in the SpiderMonkey bindings. r? @emilio
2017-06-22Minor version bump to 0.26.2Nick Fitzgerald
2017-06-22Allow marking specific template instantiations as opaqueNick Fitzgerald
If a template has a specialization that bindgen doesn't understand, it can be helpful to mark it as opaque and continue making forward progress in the meantime. This is something we need in the SpiderMonkey bindings.
2017-06-21Auto merge of #741 - tmfink:feature-699-constified-enum-module, r=emiliobors-servo
Feature 699 constified enum module This is a work in progress for issue #699 that adds the `--constified-enum-module` option to bindgen. @emilio, could you give me some guidance on fixing the uses of the enum variant types? In the example below, `foo` should be replaced with `foo::Type`. I'm not sure of the proper way to rename `Item`s after the structures have been defined. My initial thought was to redefine the `CodeGenerator` trait to take a mutable reference to `item`, but that will not work because of the borrow checker. Thoughts? Todo: - [x] put constified enum variants in a `mod` - [x] ensure references to constified enum `foo` are changed to `foo::Type` - [x] handle `typedef` enums ----- Given the input header `tests/headers/constify-module-enums.h`: ~~~c // bindgen-flags: --constified-enum-module foo enum foo { THIS, SHOULD_BE, A_CONSTANT, }; struct bar { enum foo this_should_work; }; ~~~ `$ cargo run -- tests/headers/constify-module-enums.h --constified-enum-module foo --no-layout-tests` will output: ~~~rust /* automatically generated by rust-bindgen */ pub mod foo { pub type Type = ::std::os::raw::c_uint; pub const THIS: Type = 0; pub const SHOULD_BE: Type = 1; pub const A_CONSTANT: Type = 2; } #[repr(C)] #[derive(Debug, Copy)] pub struct bar { pub this_should_work: foo, } impl Clone for bar { fn clone(&self) -> Self { *self } } ~~~
2017-06-20Simplify is_constified_enum_moduleTravis Finkenauer
Used suggested code from @emilio and also added a test for an alias to an anonymous enum.
2017-06-20Auto merge of #770 - fitzgen:issue-769-bad-instantiation-test, r=emiliobors-servo
Ensure that every item is in some module's children list Previously, if an item's parent was not a module (eg a nested class definition whose parent it the outer class definition) and the parent was not whitelisted but the item was transitively whitelisted, then we could generate uses of the item without emitting any definition for it. This could happen because we were relying on the outer type calling for code generation on its inner types, but that relies on us doing code generation for the outer type, which won't happen if the outer type is not whitelisted. This commit avoids this gotcha by ensuring that all items end up in a module's children list, and so will be code generated even if their parent is not whitelisted. This does have the downside of changing the relative order of some of the emitted code, and so this has a big diff (as will the next bindgen update for downstream dependencies) but I actually think the newer order makes more sense, for what that is worth. Fixes #769 r? @emilio
2017-06-20Add a comment about template instantiation parentageNick Fitzgerald
2017-06-20Assert that every item is a child of an ancestor moduleNick Fitzgerald
This commit adds assertions that run when the "testing_only_extra_assertions" feature is enabled, which make sure that every single item we parse is a child of some ancestor module.
2017-06-20Add dotted lines from modules to children in IR visualizationNick Fitzgerald
There's a lot of these edges so it helps to make them un-bold.
2017-06-20Ensure that every item is in some module's children listNick Fitzgerald
Previously, if an item's parent was not a module (eg a nested class definition whose parent it the outer class definition) and the parent was not whitelisted but the item was transitively whitelisted, then we could generate uses of the item without emitting any definition for it. This could happen because we were relying on the outer type calling for code generation on its inner types, but that relies on us doing code generation for the outer type, which won't happen if the outer type is not whitelisted. This commit avoids this gotcha by ensuring that all items end up in a module's children list, and so will be code generated even if their parent is not whitelisted. Fixes #769
2017-06-20Auto merge of #772 - emilio:ff, r=fitzgenv0.26.1bors-servo
codegen: Inline {read,write}_unaligned in order to support rust 1.15.
2017-06-20Minor bump.Emilio Cobos Álvarez
2017-06-20codegen: Inline {read,write}_unaligned in order to support rust 1.15.Emilio Cobos Álvarez
... Which is what Firefox uses right now.
2017-06-20Allow path separators in test-one.shNick Fitzgerald
Before this commit, test-one.sh was unusable with tests/headers/template.hpp because there were too many things with "template.hpp" as a suffix. This allows us to specify "/template.hpp" to run the test.
2017-06-20Auto merge of #771 - emilio:bump, r=noxbors-servo
Breaking version bump.
2017-06-20Breaking version bump.v0.26.0Emilio Cobos Álvarez
2017-06-20Auto merge of #764 - fitzgen:as-named-to-as-template-param, r=emiliobors-servo
Rename `AsNamed` to `AsTemplateParam` And also its trait methods `is_named` and `as_named` into `is_template_param` and `as_template_param` respectively. These new names better reflect what the trait is about. r? @emilio
2017-06-19Auto merge of #763 - rigelk:757-unstable-defaults, r=emilio,fitzgenbors-servo
switch defaults from generating unstable Rust to generating stable Rust As said in the issue: - changing the Builder::no_unstable_rust method to the Builder::unstable_rust method - changing the --no-unstable-rust flag to a --unstable-rust flag in src/options.rs - changing bindgen-flags header in the test headers to remove the --no-unstable-rust flag - removing --no-unstable-rust flag in ./test/test-one.sh Fixes #757 r? @fitzgen
2017-06-19switch defaults from generating unstable Rust to generating stable RustPierre-Antoine Rault
- changing the Builder::no_unstable_rust method to the Builder::unstable_rust method - changing the --no-unstable-rust flag to a --unstable-rust flag in src/options.rs - changing bindgen-flags header in the test headers to remove the --no-unstable-rust flag Fixes #757
2017-06-19Rename `AsNamed` to `AsTemplateParam`Nick Fitzgerald
And also its trait methods `is_named` and `as_named` into `is_template_param` and `as_template_param` respectively. These new names better reflect what the trait is about.
2017-06-19Auto merge of #762 - emilio:much-brokenness, r=fitzgenbors-servo
Moar bitfield fixes Now with the right branch name. See individual commits for details.
2017-06-19Auto merge of #761 - tmfink:script-fix, r=fitzgenbors-servo
Refactor test script Check for correct arguments, quote variables, ensure exactly one test file matches the pattern, and print usage information. Here are some examples: ~~~ $ ./tests/test-one.sh Usage: ./tests/test-one.sh <fuzzy-name> ~~~ ~~~ $ ./tests/test-one.sh zzz ERROR: no files found with pattern "zzz" ~~~ ~~~ $ ./tests/test-one.sh union ERROR: Expected exactly 1 result, got 15: ./tests/headers/struct_with_anon_unnamed_union.h ./tests/headers/union_dtor.hpp ./tests/headers/union_with_anon_union.h ./tests/headers/union_with_big_member.h ./tests/headers/anon_union.hpp ./tests/headers/union_fields.hpp ./tests/headers/union_with_anon_struct_bitfield.h ./tests/headers/struct_with_anon_union.h ./tests/headers/union-in-ns.hpp ./tests/headers/union_with_anon_unnamed_union.h ./tests/headers/union_with_anon_struct.h ./tests/headers/union_with_nesting.h ./tests/headers/union_template.hpp ./tests/headers/anon_struct_in_union.h ./tests/headers/union_with_anon_unnamed_struct.h ~~~ ~~~ $ ./tests/test-one.sh keywords ... ~~~
2017-06-18Test const mod enum variants shadowing "Type"Travis Finkenauer
2017-06-18Fix recursive aliases to const module enumTravis Finkenauer
Item::is_constified_enum_module() only returns true for the base type, not for "layers" of aliases. Added a "simple alias" test and added content to the types test.
2017-06-18codegen: Fix bitfield getter/setters so they work with NPOT sizes.Emilio Cobos Álvarez
2017-06-17Ignore output from test scriptTravis Finkenauer
2017-06-17Refactor test scriptTravis Finkenauer
Check for correct arguments, quote variables, ensure exactly one test file matches the pattern, and print usage information.
2017-06-17ir: use a bigger integer for the bitfield mask in 32bit, to avoid overflows.Emilio Cobos Álvarez
Like the ones seen in https://bugzilla.mozilla.org/show_bug.cgi?id=1365254#c22
2017-06-17ir: Correct size calculation of a bitfield unit.Emilio Cobos Álvarez
Fixes #734
2017-06-17codegen: Remove trailing whitespace.Emilio Cobos Álvarez
2017-06-17Auto merge of #756 - upsuper:mangling-win32, r=emiliobors-servo
Correct mangling hack for win32
2017-06-16Refactor namespace code and testTravis Finkenauer
2017-06-16Auto merge of #759 - emilio:constified-variant-enum-name, r=fitzgenbors-servo
codegen: Respect prepend_enum_name in constified variants. Fixes #755
2017-06-16codegen: Respect prepend_enum_name in constified variants.Emilio Cobos Álvarez
Fixes #755
2017-06-16Correct mangling hack for win32Xidorn Quan
2017-06-16Add constified module enum template testTravis Finkenauer
2017-06-16Add more constified module enum testsTravis Finkenauer
2017-06-15Auto merge of #750 - emilio:that-bug-is-going-to-hunt-me-down, r=fitzgenbors-servo
ir: Make the workaround for LLVM bug 9069 more reliable. Should fix https://github.com/zzeroo/libmodbus-rs/issues/4
2017-06-15Auto merge of #752 - emilio:mangling-hack, r=bholleybors-servo
ir: Correct mac target check.
2017-06-15Version bump to get insta-published.v0.25.5Emilio Cobos Álvarez
2017-06-15ir: Correct mac target check.Emilio Cobos Álvarez
Because I'm stupid.