summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-19Emit derive(PartialOrd)Sergey Pepyakin
2017-09-19derive_partialord in BindgenOptions and BuilderSergey Pepyakin
2017-09-19DerivePartialEq → DerivePartialEqOrPartialOrdSergey Pepyakin
2017-09-18Auto merge of #1000 - pepyakin:hide-bindgen-options, r=fitzgenbors-servo
Make BindgenOptions private Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/958 r? @fitzgen
2017-09-18Make BindgenOptions privateSergey Pepyakin
2017-09-15Auto merge of #994 - treiff:depreciate-builder-whitelist-type, r=fitzgenbors-servo
Depreciate `Builder::whitelisted_type`. Closes #987 Also, we were making a call to the now deprecated `Builder::hide_type`, changed that over to call `Builder::blacklist_type.
2017-09-15Fix whitelisting documentation links in book.Trevor Reiff
Update to reference `whitelist_type` function.
2017-09-15Depreciate `Builder::whitelisted_type`.Trevor Reiff
Closes #987 Also, we were making a call to the now deprecated `Builder::hide_type`, changed that over to call `Builder::blacklist_type.
2017-09-14Auto merge of #991 - alexeyzab:add-builder-blacklist-type, r=fitzgenbors-servo
Add a `Builder::blacklist_type` This deprecates `Builder::hide_type`. Related to #984. - [x] Add Builder::blacklist_type, that does the same thing as hide_type - [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"] - [x] Make hide_type delegate to blacklist_type - [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types - [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name - [x] Rename ir::item::Item::is_hidden to is_blacklisted r? @fitzgen
2017-09-14Auto merge of #990 - treiff:depreciate-whitelisted-function, r=fitzgenbors-servo
Depreciate whitelisted function. Closes #985 I also noticed a reference to `whitelisted_function` within the book, should this be updated as well? https://github.com/rust-lang-nursery/rust-bindgen/blob/a371de097f5e37eb01754525fb1e2029ca88b0be/book/src/whitelisting.md I've started to learn rust recently, so please let me know if there is anything I missed.
2017-09-14Add a `Builder::blacklist_type`Alexey Zabelin
This deprecates `Builder::hide_type`. Related to #984. - [x] Add Builder::blacklist_type, that does the same thing as hide_type - [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"] - [x] Make hide_type delegate to blacklist_type - [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types - [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name - [x] Rename ir::item::Item::is_hidden to is_blacklisted
2017-09-14Depreciate whitelisted function.Trevor Reiff
Closes #985
2017-09-14Auto merge of #989 - aeleos:master, r=fitzgenbors-servo
Make whitelisted_var consistant with CLI flags Closes #986 This is my first time contributing to rust so hopefully I did everything right, otherwise let me know.
2017-09-13Make whitelisted_var consistant with CLI flagsOliver Geller
2017-09-13Auto merge of #988 - fitzgen:overview, r=emiliobors-servo
Add an architectural overview of `bindgen` to CONTRIBUTING.md This should help new contributors who are coming to the code base for the first time get up and running. r? @emilio
2017-09-13Add an architectural overview of `bindgen` to CONTRIBUTING.mdNick Fitzgerald
This should help new contributors who are coming to the code base for the first time get up and running.
2017-09-11Auto merge of #976 - Cldfire:default-to-constified-enums, r=fitzgenbors-servo
Generate constants for enums by default Closes #758. The first commit does strictly what the issue description described, the second does a small amount of (what I believe is) logic simplification. Hopefully I didn't miss any tests when adding the `--rustified-enum .*` flag to the ones that needed it; all of the tests are passing for me, though, so I don't think I did.
2017-09-11Make bindgen generate enums as constants by defaultCldfire
Also simplifies the logic that determines which enum variation gets chosen.
2017-09-08Auto merge of #973 - fitzgen:help-wanted, r=fitzgenbors-servo
Add a link to issues labeled "help wanted" to CONTRIBUTING.md
2017-09-08Add a link to issues labeled "help wanted" to CONTRIBUTING.mdNick Fitzgerald
2017-09-07Auto merge of #956 - ↵bors-servo
fitzgen:document-no-recursive-whitelist-will-break-code, r=emilio Document that not recursively whitelisting is dangerous See #949 for context and motivation. r? @emilio
2017-09-07Auto merge of #940 - fitzgen:no-syntex, r=emiliobors-servo
No more syntex There are a few commits in this PR, but the big one is the commit that goes `syntex` -> `quote` for code generation. I've included a copy of its commit message below. I tried to verify that it works with the stylo build still, but there were some issues, and then I checked with master, and that wasn't working either. So now I'm C-Reducing the failures on master and figured that this is at least ready for feedback in the meantime. r? @emilio ---------------------------- The `syntex` crate is unmaintained. It is slow to build, and additionally it requires that we pre-process `src/codegen/mod.rs` before we build the `bindgen` crate. The `quote` crate provides similar quasi-quoting functionality, is maintained, and builds faster. It doesn't have a typed API or builders, however; it only deals with tokens. Before this commit: ``` $ cargo clean; cargo build <snip> Finished dev [unoptimized + debuginfo] target(s) in 98.75 secs ``` After this commit: ``` $ cargo clean; cargo build <snip> Finished dev [unoptimized + debuginfo] target(s) in 46.26 secs ``` Build time is cut in half! But what about run time? Before this commit: ``` Generated Stylo bindings in: Duration { secs: 3, nanos: 521105668 } ``` After this commit: ``` Generated Stylo bindings in: Duration { secs: 3, nanos: 548797242 } ``` So it appears to be about 20ms slower at generating Stylo bindings, but I suspect this is well within the noise. Finally, this also lets us remove that nasty `mem::transmute` inside `bindgen::ir::BindgenContext::gen` that was used for the old `syntex` context. Now `BindgenContext` doesn't have a lifetime parameter either. This should make it easier to revisit doing our analyses in parallel with `rayon`, since that context was one of the things that made it hard for `BindgenContext` to implement `Sync`. Fixes #925
2017-09-07Don't duplicate large comments; just reference them insteadNick Fitzgerald
2017-09-07Auto merge of #957 - fitzgen:no-ld-library-path, r=emiliobors-servo
LD_LIBRARY_PATH is unnecessary; LIBCLANG_PATH is enough r? @emilio
2017-09-07LD_LIBRARY_PATH is unnecessary; LIBCLANG_PATH is enoughNick Fitzgerald
2017-09-07Just check for `rustfmt`; don't install itNick Fitzgerald
2017-09-07Use the `quote!` macro for `link_name` attributesNick Fitzgerald
The latest `rustfmt` has fixed the formatting bugs we were running into.
2017-09-07Note that we need `rustfmt` to run tests nowNick Fitzgerald
2017-09-07Also print rustfmt's stderr for expectationsNick Fitzgerald
2017-09-07Explicitly install the latest rustfmt in CINick Fitzgerald
2017-09-07Add a timer for rustfmt'ing the generated bindingsNick Fitzgerald
2017-09-07We can afford the exra cycles to use double precision floats hereNick Fitzgerald
;)
2017-09-07Fix units and formatting of time phasesNick Fitzgerald
Was previously printing seconds, but claiming it was milliseconds.
2017-09-07Print time phases for the stylo sanity testNick Fitzgerald
2017-09-07Use `quote` instead of `syntex` for Rust code generationNick Fitzgerald
The `syntex` crate is unmaintained. It is slow to build, and additionally it requires that we pre-process `src/codegen/mod.rs` before we build the `bindgen` crate. The `quote` crate provides similar quasi-quoting functionality, is maintained, and builds faster. It doesn't have a typed API or builders, however; it only deals with tokens. Before this commit: ``` $ cargo clean; cargo build <snip> Finished dev [unoptimized + debuginfo] target(s) in 98.75 secs ``` After this commit: ``` $ cargo clean; cargo build <snip> Finished dev [unoptimized + debuginfo] target(s) in 46.26 secs ``` Build time is cut in half! But what about run time? Before this commit: ``` Generated Stylo bindings in: Duration { secs: 3, nanos: 521105668 } ``` After this commit: ``` Generated Stylo bindings in: Duration { secs: 3, nanos: 548797242 } ``` So it appears to be about 20ms slower at generating Stylo bindings, but I suspect this is well within the noise. Finally, this also lets us remove that nasty `mem::transmute` inside `bindgen::ir::BindgenContext::gen` that was used for the old `syntex` context. Now `BindgenContext` doesn't have a lifetime parameter either. This should make it easier to revisit doing our analyses in parallel with `rayon`, since that context was one of the things that made it hard for `BindgenContext` to implement `Sync`. Fixes #925
2017-09-07Run `rustfmt` on the test actual output and expectationsNick Fitzgerald
2017-09-07Add the TypeKind name to the IR graphviz outputNick Fitzgerald
2017-09-07Document that not recursively whitelisting is dangerousNick Fitzgerald
See #949 for context and motivation.
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-06Add a test for blacklisting and deriving PartialEqNick Fitzgerald
2017-09-06Add a test for simple blacklisting + derive(Hash)Nick Fitzgerald
We already have a test for more complicated template instantiations and blacklisting and their affects on deriving `Hash`, but it is good to have sanity tests for the simple cases too.
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-06Write test for `--no-derive--copy`mchlrhw
2017-09-06Auto merge of #953 - emilio:target, r=fitzgenbors-servo
ir: Pass the target to clang if it wasn't explicitly passed already. Fixes #942 Fixes #947
2017-09-06Check derive_copy optionmchlrhw