summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-22codegen: Try to reasonably handle enum : bool.Emilio Cobos Álvarez
Just use the repr name we generate, since we generate constants for that. It's not worth trying to guess the actual type to use IMO. Bindings lose a bit of portability I guess, but that's really a lost bet already, so instead of special-casing bool and map constants, let's use a consistent representation everywhere. Fixes #1145
2018-01-19Auto merge of #1228 - emilio:repr-c-enums, r=fitzgenbors-servo
codegen: Don't generate repr(C) for enums. That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
2018-01-19codegen: Don't generate repr(C) for enums.Emilio Cobos Álvarez
That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
2018-01-19Auto merge of #1227 - emilio:non-floating-type-complex, r=fitzgenbors-servo
ir: Handle _Complex _Float128 correctly. Unfortunately we can't test it for the same alignment issues that "long double" has. I also included the diagnostic code, just in case it happens again.
2018-01-19ir: Handle _Complex _Float128 correctly.cris-b
Unfortunately we can't test it for the same alignment issues that "long double" has. Fixes #1087
2018-01-17Auto merge of #1052 - ambaxter:bitfield_docs, r=fitzgenbors-servo
Added mdbook entry for bitfields. Fixes #818
2018-01-17Fixed typo.Adam Baxter
2018-01-16ir: Give more info for the non-floating type complex type message.Emilio Cobos Álvarez
2018-01-16Updated to fix nitpicksAdam Baxter
2018-01-10Merge pull request #1220 from acmcarther/patch-1Emilio Cobos Álvarez
Make CARGO_PKG_VERSION option_env!, rather than env!
2018-01-09Make CARGO_PKG_VERSION option_env!, rather than env!Alex McArther
2018-01-09Merge pull request #1218 from emilio/clang-trunkEmilio Cobos Álvarez
Clang trunk considers stuff in an anonymous namespace with internal linkage.
2018-01-07Clang trunk considers stuff in an anonymous namespace with internal linkage.Emilio Cobos Álvarez
I think that's right, and the previous behavior was just a bug. Rejigger the tests that show this difference since they aren't testing this in particular, and avoids adding more per-platform tests.
2018-01-06Auto merge of #1217 - emilio:variadic, r=pepyakinbors-servo
codegen: Be consistent about variadic signatures. Fixes #1216.
2018-01-06Merge pull request #1207 from glyn/license-compatibilityEmilio Cobos Álvarez
Fix license incompatibility
2018-01-06codegen: Be consistent about variadic signatures.Emilio Cobos Álvarez
Fixes #1216.
2018-01-06Merge pull request #1209 from Ekleog/masterEmilio Cobos Álvarez
Mark C++ exceptions as unsupported in the book
2018-01-05Auto merge of #1214 - kornelski:master, r=emiliobors-servo
Correct type for --whitelist-type doc
2018-01-05Correct type for --whitelist-type docKornel
2018-01-04Auto merge of #1210 - emilio:travis-maybe, r=emiliobors-servo
Fix travis. Per https://docs.travis-ci.com/user/languages/cpp/, though not super-confident this will fix it.
2018-01-04ci: Fix Travis.Emilio Cobos Álvarez
2018-01-03Mark C++ exceptions as unsupported in the bookLéo Gaspard
2018-01-02Auto merge of #1189 - nox:is-dir, r=fitzgenbors-servo
Use Metadata::is_dir
2018-01-02Fix license incompatibilityGlyn Normington
Make issue-816.h compatible with bindgen's 3-clause BSD license. This fixes issue https://github.com/rust-lang-nursery/rust-bindgen/issues/1206.
2018-01-01Auto merge of #1204 - Kobata:rustfmt-pr, r=emiliobors-servo
Revert to only calling plain rustfmt rust-lang-nursery/rustup.rs#1294 added a proxy executable for rustfmt that will act on the correct bundled rustfmt for the default release channel set by rustup. And, assuming I'm reading the expected release notes correctly, it seems like rust 1.23, due out fairly shortly, will add the bundled version of rustfmt to stable. This fixes #1184
2018-01-01Revert to only calling plain rustfmtKobata
2017-12-29Auto merge of #1199 - emilio:pure-virtual, r=pepyakinbors-servo
Don't generate symbols for pure virtual functions. Fixes #1197.
2017-12-29Don't generate symbols for pure virtual functions.Emilio Cobos Álvarez
Fixes #1197.
2017-12-18Auto merge of #1196 - fitzgen:bump-to-0.32.1, r=KiChjangbors-servo
Bump to 0.32.1 minor release rs? @emilio
2017-12-18Bump to 0.32.1 minor releaseNick Fitzgerald
2017-12-14Auto merge of #1193 - alex:patch-1, r=emiliobors-servo
Fixed rendering of a header in the book
2017-12-14Auto merge of #1183 - fitzgen:repr-c-on-enums, r=emiliobors-servo
repr(C) on enums r? @pepyakin or @emilio
2017-12-13Fixed rendering of a header in the bookAlex Gaynor
2017-12-12Always add `repr(C)` to rustified enumsNick Fitzgerald
If we don't, then eddyb's recent layout optimizations will do unexpected things to them. We also need to handle empty `enum`s without variants. When `repr(C)` is on a Rust `enum`, it cannot be empty, so we need to add a dummy.
2017-12-11Use Metadata::is_dirAnthony Ramine
2017-12-09Auto merge of #1186 - manaskarekar:issue-1182, r=emiliobors-servo
Fix command_line_flags mis-generation of rust-target's flags. Trying to address issue #1182. r? @fitzgen
2017-12-09Fix command_line_flags mis-generation of rust-target's flags.Manas Karekar
Expand tests for testing the rust-target flag generated by builder.
2017-12-09Auto merge of #1180 - snewt:feat/quickchecking-cargo-features, r=fitzgenbors-servo
Enable Cargo features for quickchecking crate Logic to enable/disable special casing (due to known issues #550, #684, and #1153) has been exposed as features in the `quickchecking` crate's Cargo.toml file and corresponding `cfg` attributes in the source. In addition to adding Cargo features, this PR represents the following: - Documentation in `bindgen`'s CONTRIBUTING.md that points to a new README.md located in the `quickchecking` crate's directory. - The Debug trait was implemented for the `HeaderC` type. This enables failing property tests to be reported as C source code rather than a Rust data structure. - The ArrayDimensionC type is now used in header generation for union, struct, and basic declarations. Thanks for taking a look and for any feedback! Closes #1169 r? @fitzgen
2017-12-08Address PR change requestsShea Newton
- Fixed misspelling introduced in CONTRIBUTING.md - Remove `quickchecking -h` output from README.md
2017-12-08predicate.py: Add an option to not delete temp filesNick Fitzgerald
Useful when debugging.
2017-12-08Auto merge of #1181 - fitzgen:version-bump-to-0.32.0, r=emiliobors-servo
Bump to 0.32.0 r? @emilio
2017-12-08Bump to 0.32.0Nick Fitzgerald
2017-12-07Enable Cargo features for quickchecking crateShea Newton
Logic to enable/disable special casing (due to known issues #550, #684, and #1153) has been exposed as features in the `quickchecking` crate's Cargo.toml file and corresponding `cfg` attributes in the source. In addition to adding Cargo features, this PR represents the following: - Documentation in `bindgen`'s CONTRIBUTING.md that points to a new README.md located in the `quickchecking` crate's directory. - The Debug trait was implemented for the `HeaderC` type. This enables failing property tests to be reported as C source code rather than a Rust data structure. - The ArrayDimensionC type is now used in header generation for union, struct, and basic declarations. Thanks for taking a look and for any feedback! Closes #1169 r? @fitzgen
2017-12-07Auto merge of #1176 - Eijebong:bump, r=fitzgenbors-servo
Update lazy_static to 1.0
2017-12-07Update lazy_static to 1.0Bastien Orivel
2017-12-07Auto merge of #1179 - fitzgen:add-regression-test-for-issue-816, r=emiliobors-servo
Add a regression test for issue #816 r? @emilio
2017-12-07Add a regression test for issue #816Nick Fitzgerald
2017-12-05Auto merge of #1177 - snewt:feat/quickcheck-as-bin, r=fitzgenbors-servo
Quickchecking crate CLI Prior to this commit the quickchecking crate used for generating proprty tests for bindgen was a [lib] target and had configurations that required commenting/uncommenting code to enable/disable. This meant it was inconvienent/prohibitive to configure the property tests on a per-run basis. This commit reorganizes the `quickchecking` crate to provide both [lib] and [[bin]] targets in order to expose those configurations through a CLI. The configurations that are exposed through the [[bin]] target's CLI are: * Count/number of tests to run. * Directory to provide fuzzed headers * Generation range corresponding to the range quickcheck uses to * generate arbitrary. __Usage from the__ `tests/quickchecking` __directory__ ```bash quickchecking 0.2.0 Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script USAGE: quickchecking [OPTIONS] FLAGS: -h, --help Prints help information -V, --version Prints version information OPTIONS: -c, --count <COUNT> Count / number of tests to run. Running a fuzzed header through the predicate.py script can take a long time, especially if the generation range is large. Increase this number if you're willing to wait a while. [default: 2] -p, --path <PATH> Optional. Preserve generated headers for inspection, provide directory path for header output. [default: None] -r, --range <RANGE> Sets the range quickcheck uses during generation. Corresponds to things like arbitrary usize and arbitrary vector length. This number doesn't have to grow much for that execution time to increase significantly. [default: 32] ``` Because the actual work of running the property tests moved to the [[bin]] target, rather than duplicate that code in the `quickchecking` crate's tests directory, some actual (very basic) tests for the `quickchecking` crate were added. *Note: I'm not attached to any of the option flags, if there are better characters/words for any of the options I've exposed I'll be happy to revise! Also, I'm not sure how palatable the "global singleton" is for managing context (output path) across tests in the `lib.rs` file. Very open to suggestions on how to manage that if it's not an acceptable approach. Thanks for taking a look, looking forward to feedback! Closes #1168 r? @fitzgen
2017-12-05quickchecking CI testsShea Newton
The changes reflected in this PR include the logic to test the `quickcheking` crate itself. Rather that just validate that the `quickchecking` crate builds in CI with `cargo check`, we can run now `cargo test`.
2017-12-04Quickchecking crate CLIShea Newton
Prior to this commit the quickchecking crate used for generating proprty tests for bindgen was a [lib] target and had configurations that required commenting/uncommenting code to enable/disable. This meant it was inconvienent/prohibitive to configure the property tests on a per-run basis. This commit reorganizes the `quickchecking` crate to provide both [lib] and [[bin]] targets in order to expose those configurations through a CLI. The configurations that are exposed through the [[bin]] target's CLI are: * Count/number of tests to run. * Directory to provide fuzzed headers * Generation range corresponding to the range quickcheck uses to * generate arbitrary. __Usage from the__ `tests/quickchecking` __directory__ ```bash quickchecking 0.2.0 Bindgen property tests with quickcheck. Generate random valid C code and pass it to the csmith/predicate.py script USAGE: quickchecking [OPTIONS] FLAGS: -h, --help Prints help information -V, --version Prints version information OPTIONS: -c, --count <COUNT> Count / number of tests to run. Running a fuzzed header through the predicate.py script can take a long time, especially if the generation range is large. Increase this number if you're willing to wait a while. [default: 2] -p, --path <PATH> Optional. Preserve generated headers for inspection, provide directory path for header output. [default: None] -r, --range <RANGE> Sets the range quickcheck uses during generation. Corresponds to things like arbitrary usize and arbitrary vector length. This number doesn't have to grow much for that execution time to increase significantly. [default: 32] ``` Because the actual work of running the property tests moved to the [[bin]] target, rather than duplicate that code in the `quickchecking` crate's tests directory, some actual (very basic) tests for the `quickchecking` crate were added. *Note: I'm not attached to any of the option flags, if there are better characters/words for any of the options I've exposed I'll be happy to revise! Thanks for taking a look, looking forward to feedback! Closes #1168 r? @fitzgen