summaryrefslogtreecommitdiff
path: root/src/options.rs
AgeCommit message (Collapse)Author
2018-10-13Changed 'identifier' to 'item', added c++ testJason Reed
2018-10-12Re-add ability to blacklist arbitrary identifiersJason Reed
(regardless of which sort of Item they are)
2018-10-04Puts blocks behind a switch.Emilio Cobos Álvarez
Since #1378 broke a bunch of OSX builds. Most people don't care about them and they're in some OSX system headers which means that this could break normal C and C++ stuff. This introduces --generate-block / generate_block to generate these signatures, and adds tests so that this is getting tested.
2018-09-10generate type alias for the `block` typeFlier Lu
2018-08-29options: mark clang-args lastSymphorien Gibol
before, bindgen -- -I blah would try to open `-I` as a header file.
2018-08-14Convert CodegenOptions to a bitfield.Sébastien Duquette
2018-08-13Add ability to blacklist functions.Emilio Cobos Álvarez
Fixes #1336
2018-06-04add --constified-enum to output consts when the default is changedDaniel Brooks
2018-06-04Rename from "enum variant" to "enum style"Daniel Brooks
2018-06-03Add an option to set the default codegen style for all enumsDaniel Brooks
2018-03-31options: Remove the linking-related options.Emilio Cobos Álvarez
They do nothing, and are effectively superseded by --raw-line and friends. They also tend to confuse people. Closes #104
2018-03-04Untry.Emilio Cobos Álvarez
Use the ? operator instead of try, and add some more uses of it on Option<> that were straight-forward.
2018-01-27Support str as input to Builder::no_* functionsRyan Osial
Previously, only String was supported on these while other functions in Builder worked with both str and String
2018-01-09Make CARGO_PKG_VERSION option_env!, rather than env!Alex McArther
2018-01-05Correct type for --whitelist-type docKornel
2017-10-26give better variable nameTaylor Foxhall
2017-10-27Add --no-hash <regex> flagseemyvest
2017-10-24Resolve #962 - implement --no-copy with testsTaylor Foxhall
generated bindings from test headers
2017-10-03Derive partialeq "manually" when possibleSergey Pepyakin
Remove derive-partialeq-template-inst test. Add comments. Don't implement PartialEq for incomplete arrays Handle opaque bases and template instantiations Extract constrain_type. Extract `is whitelisted?` check Add failing partialeq-anonfield join for comps Fix: return insert if not whitelisted Delegate TypeRefs and alias to constrain_join. Delegate Template instantiations to constrain_join Add derive-partialeq-pointer.hpp test Update comment. Fix layout alignment larger that array limit Add missing test for derive-partialeq-anonfield.rs Clean Clean Fix typo in opaque-template-inst-member test Remove redudant stmt Add comment on can_supersede. Format impl_partialeq and leave a comment Extract requires_storage into it's own function. Clean
2017-09-22Enable --rustfmt-bindings by defaultHarlan Haskins
This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables formatting by default. If rustfmt is not accessible, a warning is printed and the bindings are printed unformatted.
2017-09-19Auto merge of #996 - alexeyzab:add-no-partialeq-command, r=fitzgenbors-servo
Add --no-partialeq <regex> flag Related to #965. - [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set). - [x] A Builder method to add strings to that RegexSet. - [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method. - [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id). - [x] Tests! - [x] When the no-partialeq type is transitively referenced by a whitelisted item - [x] When the no-partialeq type is explicitly whitelisted - [x] When the no-partialeq type is marked opaque This is my first pass at implementing this functionality, I haven't implemented the tests yet. I wanted to make sure I am on the right track, particularly when it comes to updating `MonotoneFramework::constrain`. r? @fitzgen
2017-09-19Add --no-partialeq <regex> flagAlexey Zabelin
- [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set). - [x] A Builder method to add strings to that RegexSet. - [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method. - [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id). - [x] Tests! - [x] When the no-partialeq type is transitively referenced by a whitelisted item - [x] When the no-partialeq type is explicitly whitelisted - [x] When the no-partialeq type is marked opaque Fixes #965
2017-09-19Clean.Sergey Pepyakin
2017-09-19Derive Ord when possibleSergey Pepyakin
2017-09-19derive_partialord in BindgenOptions and BuilderSergey Pepyakin
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 #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-14Depreciate whitelisted function.Trevor Reiff
Closes #985
2017-09-13Make whitelisted_var consistant with CLI flagsOliver Geller
2017-09-11Make bindgen generate enums as constants by defaultCldfire
Also simplifies the logic that determines which enum variation gets chosen.
2017-09-07Don't duplicate large comments; just reference them insteadNick Fitzgerald
2017-09-07Document that not recursively whitelisting is dangerousNick Fitzgerald
See #949 for context and motivation.
2017-09-06Add `bindgen::Builder::derive_copy`mchlrhw
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-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-14Can derive PartialEq analysisZhiting Zhu
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-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-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-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-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.
2017-07-28Remove the incomplete `--dummy-uses` featureNick Fitzgerald
This would generate dummy uses of all the whitelisted types, which we were planning on eventually using to generate DWARF for more layout testing of our types, but we decided that isn't worth the trouble. Kill it!
2017-07-26Report what the unknown generate item was when parsing `--generate`Nick Fitzgerald
2017-07-25s/servo/rust-lang-nursery/ \o/Nick Fitzgerald
Fixes #852