summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-09-06Auto merge of #950 - fitzgen:no-derive-copy-for-blacklisted-types, r=emiliobors-servo
Derive + blacklisted types * [X] document blacklisting + derive interaction * [X] derive `Copy` * [X] derive `Debug` * [X] `--impl-debug` * [x] derive `Default` * [x] derive `Hash` * [x] derive `PartialEq`
2017-09-06Do not derive things on opaque unionsNick Fitzgerald
Unions don't support deriving these things, even if there is only one variant (the opaque layout field).
2017-09-06Pessimistically assume that blacklisted types do not implement DefaultNick Fitzgerald
2017-09-06Reflect whitelisted status via color in graphviz dot filesNick Fitzgerald
This makes it so that whitelisted items and edges outgoing from them are black, while non-whitelisted items and their edges are gray.
2017-09-06Don't try and debug format blacklisted types when generating `impl Debug` blocksNick Fitzgerald
2017-09-06Be pessimistic about `derive(Debug)` and blacklisted typesNick Fitzgerald
2017-09-06Auto merge of #952 - mchlrhw:master, r=fitzgenbors-servo
Add `bindgen::Builder::derive_copy` Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/948
2017-09-06Check derive_copy optionmchlrhw
2017-09-06Add `bindgen::Builder::derive_copy`mchlrhw
2017-09-06ir: Pass the target to clang if it wasn't explicitly passed already.Emilio Cobos Álvarez
Fixes #942 Fixes #947
2017-09-05Do not derive Copy for blacklisted typesNick Fitzgerald
Presumably they are blacklisted because we can't understand them properly, so be pessimistic about what we can derive for it. Fixes #944.
2017-09-04ir: Fix definitions outside of base class manually tracking the correct parent.Emilio Cobos Álvarez
2017-09-04ir: When something has a definition, return unresolved type references until ↵Emilio Cobos Álvarez
we parse it. This ensures that we see all the relevant types that are defined when parsing the definition, avoiding problems like #888. Fixes #888
2017-08-30Squash commit for --time-phases command line optionJackson O'Donnell
initial timer branch commit added time_phases builder parameter create timers for BindgenContex analyses, codegen time parse added docstrings added fitzgens suggestions add --time-phases to bindgen::Builder::command_line_flags
2017-08-29Auto merge of #936 - jhod0:no_fieldgen_on_opaque, r=fitzgenbors-servo
Avoid generating fields/methods for opaque objects WIP fix for issue #929 With libclang 4, passes all tests on my machine except `dump_preprocessed_input`, but that fails on the master branch as well
2017-08-29removed commented code, added punctuationJackson O'Donnell
2017-08-28no fields or methods created for opaqueJackson O'Donnell
2017-08-25Auto merge of #932 - bd339:has_destructor_fp, r=fitzgenbors-servo
Rewrite `has destructor` analysis as a fixed-point analysis Fixes #927 . Note that this creates a dependency between the "cannot derive copy" and "has destructor" analysis, i.e. the "has destructor" analysis must run before the "cannot derive copy" analysis, because "cannot derive copy" needs the results of "has destructor".
2017-08-25Rewrite the `has destructor` analysis as a fixed-point analysis in the ↵Benjamin Dahse
monotone framework
2017-08-24Simplify helpers::blobMalo Jaffré
Thanks @fitzgen for the detailed instructions. Fixes #928.
2017-08-21Can derive EqZhiting Zhu
2017-08-21Rename `TypeKind::Named` to `TypeKind::TypeParam`Anna Liao
Also renames a bunch of other things referring to named types to refer to type parameters. Fixes #915
2017-08-19Update doc for unionsTravis Finkenauer
Addresses #832
2017-08-17Auto merge of #920 - photoszzt:fix_comments, r=emiliobors-servo
Fix misleading comments r? @fitzgen or @emilio
2017-08-16Fix misleading commentsZhiting Zhu
2017-08-16Check if `clang_Type_getNumTemplateArguments` is loaded before useNick Fitzgerald
Older clang don't have it, and while we can't pass our whole test suite with those older clangs, we can still generate simple C bindings, so it makes sense not to panic for C++ only things.
2017-08-14Only compute which types we can derive PartialEq for if we'll use itNick Fitzgerald
If we aren't going to derive `PartialEq`, then it doesn't make sense to even run the analysis.
2017-08-14Auto merge of #912 - fitzgen:only-run-analyses-if-needed, r=emiliobors-servo
Only run analyses when we are going to use their results Currently, there are various analyses related to deriving various traits that we unconditionally run. However, if we aren't going to derive those traits in codegen, then computing whether or not we can derive the traits is wasteful. r? @emilio
2017-08-14Only run analyses when we are going to use their resultsNick Fitzgerald
Currently, there are various analyses related to deriving various traits that we unconditionally run. However, if we aren't going to derive those traits in codegen, then computing whether or not we can derive the traits is wasteful.
2017-08-14Can derive PartialEq analysisZhiting Zhu
2017-08-14Disables --rustfmt-bindgens by defaultBastian Köcher
2017-08-14Improves error handling for rustfmtBastian Köcher
2017-08-14Renames format-* command-line arguments to rustfmt-*Bastian Köcher
The --rustfmt-configuration-file command-line argument automatically activates --rustfmt-bindings.
2017-08-14Fixes compilation warnings with rustc 1.21.0-nightly (13d94d5fa 2017-08-10)Bastian Köcher
2017-08-14Adds support for running rustfmt on generated bindingsBastian Köcher
This patch enables bindgen to run rustfmt on generated bindings. Rustfmt is used from the global PATH. Two new command-line arguments are added: 1. --format-bindings: Enables running rustfmt 2. --format-configuration-file: The configuration file for rustfmt (not required).
2017-08-14Auto merge of #909 - bkchr:union_fix, r=emiliobors-servo
Fixes alignment errors with new Rust union type This fix creates a new private field with the required aligned size. This new private field ensures that the union has the required size. This fixes: #908
2017-08-14Fixes alignment errors with new Rust union typeBastian Köcher
This fix creates a new private field with the required aligned size. This new private field ensures that the union has the required size.
2017-08-14Auto merge of #911 - upsuper:layout-test-name, r=emiliobors-servo
Stablize name of reference and nested combination of ref, ptr, and array
2017-08-14Remove Type::is_valid_identifierXidorn Quan
2017-08-14Auto merge of #892 - tmfink:feature-832-custom-rust-target, r=emiliobors-servo
Re-add --rust-target option to replace --unstable-rust Re-apply commit. Addresses #832 Instead of specifying whether or not to use stable, specify the Rust release to support (one of several stable/beta releases or nightly). The `--unstable-rust` option is still accepted and implies nightly. The definitions of `RustTarget` and `RustFeatures` are created with macros. For each test that uses unions, there is a version that uses the latest stable and 1.0.
2017-08-14Stablize name of reference and nested combination of ref, ptr, and arrayXidorn Quan
2017-08-13Re-add --rust-target to replace --unstable-rustTravis Finkenauer
Instead of specifying whether or not to use stable, specify the Rust release to support (one of several stable/beta releases or nightly). The `--unstable-rust` option is still accepted and implies nightly. The definitions of `RustTarget` and `RustFeatures` are created with macros. For each test that uses unions, there is a version that uses the latest stable and 1.0. This also fixes the bug where unions were generated with non-Copy fields.
2017-08-13ir: Sanitize base names more aggressively.Emilio Cobos Álvarez
This fixes stylo build failures when template instantiations tests caused a rust compile error due to a bad test name. This commit makes names better sanitized, preventing similar errors in the future.
2017-08-10Auto merge of #899 - bkchr:manual_debug_impl, r=fitzgenbors-servo
Implements Debug trait for types which do not support derive Debug For types that do not support derive Debug be implemented automatically by rust, we know can generate implementations of the Debug trait. This code generation is hidden behind the '--force-derive-debug' command-line flag. Should solve: #875 Sorry for the extra noise in lib.rs, codegen/mod.rs etc, that was rustfmt.
2017-08-11Renames cli --force-derive-debug to --impl-debugBastian Köcher
2017-08-10Adds ImplDebug trait for creating the Debug trait implementationsBastian Köcher
2017-08-10Implements Debug trait for types which do not support derive DebugBastian Köcher
For types that do not support derive Debug be implemented automatically by rust, we know can generate implementations of the Debug trait. This code generation is hidden behind the '--force-derive-debug' command-line flag.
2017-08-09Can derive Hash analysiszzhu
2017-08-04Revert "Add --rust-target to replace --unstable-rust"Nick Fitzgerald
This reverts commit 0bb7b9f1c4652f63f41eba4064b79c044fd3d955. It turns out our CI stopped running test expectations in an earlier regression (from d73507e; fix incoming) and so this pull request actually introduced a bunch of failures when compiling the test expectations and running their unit tests :(
2017-08-04Add --rust-target to replace --unstable-rustTravis Finkenauer
Instead of specifying whether or not to use stable, specify the Rust release to support (one of several stable/beta releases or nightly). The --unstable-rust option is still accepted and implies nightly. The definitions of `RustTarget` and `RustFeatures` are created with macros. For each test that uses unions, there is a version that uses the latest stable release and stable 1.0.