Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
Homebrew now defaults to llvm 4.0.x so there's no need to
specify a specific version to get compatibility.
|
|
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
|
|
|
|
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
|
|
|
|
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.
|
|
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 }
}
~~~
|
|
Used suggested code from @emilio and also added a test for an alias to
an anonymous enum.
|
|
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
|
|
|
|
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.
|
|
There's a lot of these edges so it helps to make them un-bold.
|
|
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
|
|
codegen: Inline {read,write}_unaligned in order to support rust 1.15.
|
|
|
|
... Which is what Firefox uses right now.
|
|
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.
|
|
Breaking version bump.
|
|
|
|
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
|
|
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
|
|
- 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
|
|
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.
|
|
Moar bitfield fixes
Now with the right branch name. See individual commits for details.
|
|
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
...
~~~
|
|
|
|
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.
|
|
|
|
|
|
Check for correct arguments, quote variables, ensure exactly one test
file matches the pattern, and print usage information.
|
|
Like the ones seen in https://bugzilla.mozilla.org/show_bug.cgi?id=1365254#c22
|
|
Fixes #734
|
|
|
|
Correct mangling hack for win32
|
|
|
|
codegen: Respect prepend_enum_name in constified variants.
Fixes #755
|
|
Fixes #755
|
|
|
|
|
|
|
|
ir: Make the workaround for LLVM bug 9069 more reliable.
Should fix https://github.com/zzeroo/libmodbus-rs/issues/4
|
|
ir: Correct mac target check.
|
|
|
|
Because I'm stupid.
|