summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-08Move check for field size outside loopDominik Boehi
2017-04-08Omit accessor functions for large bitfieldsDominik Boehi
2017-04-07Provide better diagnostics for assertions in the template analysisNick Fitzgerald
This replaces various `unwrap` calls with `expect` calls that have better diagnostic messages if/when they fail.
2017-04-07Define extra assertion macrosNick Fitzgerald
This commit defines a new set of assertion macros that are only checked in testing/CI when the `testing_only_extra_assertions` feature is enabled. This makes it so that *users* of bindgen that happen to be making a debug build don't enable all these extra and expensive assertions. Additionally, this removes the `testing_only_assert_no_dangling_items` feature, and runs the assertions that were previously gated on that feature when the new `testing_only_extra_assertions` feature is enabled.
2017-04-06Clean up testing-only cargo featuresNick Fitzgerald
This commit ensures that all of the cargo features we have that only exist for CI/testing purposes, and aren't for external consumption, have a "testing_only_" prefix.
2017-04-06Auto merge of #617 - fitzgen:bin-doc-false, r=emiliobors-servo
Don't build documentation for the binary, just the lib This enables one to locally do $ cargo doc and get library level documentation. Without the changes, cargo doesn't know whether to build docs for the binary or library, and so instead it gives an error and stops. r? @emilio
2017-04-06Don't build documentation for the binary, just the libNick Fitzgerald
This enables one to locally do $ cargo doc and get library level documentation. Without the changes, cargo doesn't know whether to build docs for the binary or library, and so instead it gives an error and stops.
2017-04-05Auto merge of #616 - fitzgen:explicit-test-for-default-type-parameters, r=emiliobors-servo
Add a test explicitly for default type parameters This is exercised in other tests, but in a round about fashion. It is nice to have a test that explicitly exercises default type parameters, without any cruft. r? @emilio
2017-04-05Add a test explicitly for default type parametersNick Fitzgerald
This is exercised in other tests, but in a round about fashion. It is nice to have a test that explicitly exercises default type parameters, without any cruft.
2017-04-04Auto merge of #614 - fitzgen:not-just-builtin-templates, r=emiliobors-servo
Generalize template instantiation fallibility Return `None` whenever we can't find a template definition, not only when the template is a builtin. Hitting this in other tests with libclang 4 r? @emilio or @upsuper
2017-04-04Warn when we can't find a template definitionNick Fitzgerald
But only if the type is not a builtin type. If it is a builtin type, then it's expected that we won't have a definition.
2017-04-04Generalize fallibility template instantiation fallibilityNick Fitzgerald
Return `None` whenever we can't find a template definition, not only when the template is a builtin.
2017-04-04Auto merge of #613 - fitzgen:upsuper-libclang-4, r=emiliobors-servo
Handle when we can't instantiate templates because we can't find a template definition https://github.com/servo/rust-bindgen/pull/594 + my review commetn about using opaque types
2017-04-04Use opaque types rather than continuing when template instantiation failsNick Fitzgerald
2017-04-04Ignore builtin template when parsing.Xidorn Quan
This should fix #584.
2017-04-04Auto merge of #612 - fitzgen:fallback-to-opaque, r=emiliobors-servo
Fall back to opaque types rather than panicking on parse failure Getting closer to figuring out some of the other template related issues in clang 4.0, but not quite ready to land them yet. Figure this should probably land in the meantime. This is just a better fallback in the face of the unknown for panics that we've had reports of in the wild, but which I haven't had time to creduce. r? @emilio
2017-04-04Add warning when we fall back to opaque blobsNick Fitzgerald
2017-04-04Auto merge of #609 - dimbleby:signed-char, r=emiliobors-servo
Treat char as c_char Per #603. This still leaves `bindgen` having to make a call as to what to say when asked whether `Char` `is_signed()`. I've opted just to leave this as `true`, on the grounds that: * I don't currently understand an example where it matters * I suspect that if there are cases where it matters, then it shouldn't! * Because by definition, use of unadorned `char` in the original header says that it doesn't care about signedness * (signed is the common case, so that's a more sensible guess than unsigned)
2017-04-04Tidy up handling of charDavid Hotham
2017-04-03Fall back to opaque types rather than panicking on parse failureNick Fitzgerald
2017-04-03Auto merge of #610 - emilio:char, r=fitzgenbors-servo
ir: Handle char in a more cross-platform way when possible. This should address #603, and supersede #609
2017-04-04ir: Handle char in a more cross-platform way when possible.Emilio Cobos Álvarez
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-03Auto merge of #608 - emilio:destructor-codegen, r=fitzgenbors-servo
Destructor codegen Based on #542, and on top of #606, with a bunch more tests and fixes.
2017-04-04ir: Add a note about cpp_demangle.Emilio Cobos Álvarez
2017-04-04tests: Add negative tests for constructor/destructor generation behavior.Emilio Cobos Álvarez
2017-04-04codegen: Simplify method implementations.Emilio Cobos Álvarez
2017-04-04codegen: Add integration tests for destructors.Emilio Cobos Álvarez
2017-04-04codegen: Rename the destructor methods to "destruct".Emilio Cobos Álvarez
2017-04-04options: Allow configuring destructors via CLI.Emilio Cobos Álvarez
2017-04-04Refactor a bit and do not generate virtual destructors.Emilio Cobos Álvarez
2017-04-04Add codegen for destructors.Nikhil Shagrithaya
2017-04-04ir: Force the D1 destructor symbol even in older libclang versions.Emilio Cobos Álvarez
2017-04-03options: Allow configuring the generation of constructors.Emilio Cobos Álvarez
2017-03-31Auto merge of #604 - tsliang:master, r=fitzgenbors-servo
This should resolve #571. As discussed with @fitzgen I have moved the builtin-filtering out of `ast_dump` itself; this logic now happens at the point of call in `src/lib.rs`
2017-03-31#571: Allow ast_dump to print builtins; filter builtins locallyTai Sassen-Liang
2017-03-31Merge pull request #602 from emilio/clang-5Emilio Cobos Álvarez
clang: Fix most of the clang 5.0 regressions in our tests.
2017-03-30 clang: Fix most of the clang 5.0 regressions in our tests.Emilio Cobos Álvarez
2017-03-27Auto merge of #601 - luser:string-input, r=emiliobors-servo
Add a `Builder::header_contents` method to allow passing source code as a string to a Builder Currently the Builder API requires input as header files on disk. This allows passing C source directly to clang using the existing UnsavedFile struct. I'm going to take a shot at implementing a webapp that lets users paste in C source and get the bindgen output. It would make life easier if I didn't have to write the source out to a temp file. This patch allows passing the source in as a `&str`. I wasn't quite sure where to put the new test, but it seems to work in tests.rs.
2017-03-27Add a `Builder::header_contents` method to allow passing source code as a ↵Ted Mielczarek
string to a Builder Currently the Builder API requires input as header files on disk. This allows passing C source directly to clang using the existing UnsavedFile struct.
2017-03-27Auto merge of #600 - emilio:fwd-enum, r=upsuperbors-servo
ir: Prefer the enum definition instead of the declaration when looking for variants. Fixes #599
2017-03-27tests: Disable rustfmt tests, for now.Emilio Cobos Álvarez
2017-03-23ir: Prefer the enum definition instead of the declaration when looking for ↵Emilio Cobos Álvarez
variants.
2017-03-21Auto merge of #597 - servo:void-vtable, r=fitzgen,emiliobors-servo
Make vtables non-zero-size to fix a rustc warning. ``` warning: found non-foreign-function-safe member in struct marked #[repr(C)]: found zero-size struct in foreign module, consider adding a member to this struct ``` Emilio said on IRC: > the empty vtable means that we don't care of figuring out the proper vtable layout, so we create an empty struct Sounds like all that matters is to have a pointer, we don’t look at the data behind it. Using `c_void` seems appropriate, then.
2017-03-21Make vtables non-zero-size to fix a rustc warning.Simon Sapin
``` warning: found non-foreign-function-safe member in struct marked #[repr(C)]: found zero-size struct in foreign module, consider adding a member to this struct ```
2017-03-21Do not derive Default on vtable typesSimon Sapin
https://github.com/servo/rust-bindgen/pull/597#issuecomment-288006557
2017-03-20Auto merge of #595 - emilio:force-inline, r=SimonSapinbors-servo
options: Allow force-generating inline functions.
2017-03-20options: Allow force-generating inline functions.Emilio Cobos Álvarez
2017-03-18Auto merge of #591 - ambaxter:macro_exp, r=emiliobors-servo
How would you suggest testing this?
2017-03-17Renamed chooser to visitor and added function for parsed macro analysis.Adam Baxter
Added tests and fixed missed function rename. Fixed nits Renamed visitor to callbacks. Renamed visitor to callbacks. Renamed visitor to callbacks. Fixed text.
2017-03-16Auto merge of #589 - fitzgen:conflicting-methods-and-bitfield-accessors, ↵bors-servo
r=emilio Resolve namespace clashes between methods and generated bitfield accessors This commit makes bitfields' accessor codegen detect conflicting method names and generate alternative, non-conflicting names instead. Yes, I really hit this in SpiderMonkey... r? @emilio