summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-11-16Avoid superfluous repeated builds on TravisJeff Waugh
2016-11-15Auto merge of #261 - jdub:named-tests, r=emiliobors-servo
Generate a separate test function for every header - Header tests can now be run selectively, e.g. `cargo test header` will test all headers `cargo test union` will test headers with 'union' in the file name - The list of test functions is generated by `build.rs`, so never needs to be updated - Clever approach suggested by @fitzgen This PR depends on #204, so will include those changes until they're merged into master and this can be rebased. But I'll keep the commits separate.
2016-11-16Generate a separate test function for every headerJeff Waugh
- Header tests can now be run selectively, e.g. `cargo test union` will test all headers with 'union' in the file name. - The list of test functions is generated by `build.rs`, so never needs to be updated. - Clever approach suggested by @fitzgen.
2016-11-15Auto merge of #204 - jdub:logless-library, r=emiliobors-servo
Split off bindgen library into a sub-crate - Unfortunately there's a dependency on log via syntex_errors, so we don't get rid of it all - I can't find a more sensible way to set dependencies based on whether you're building the lib or bin - So `--no-default-features` means you need to know what you're doing, as only the lib will build without the logging crates for now - The replacement log macros are pretty gross too, but they show a proof of concept ;-)
2016-11-16Remove plugin and its documentationJeff Waugh
2016-11-16Document library usageJeff Waugh
2016-11-16Transition to libbindgen sub-crateJeff Waugh
- The root crate is the `bindgen` binary - Rust-ify the test suite, no more subprocesses! - Update Travis config to test both crates
2016-11-15Auto merge of #263 - emilio:itemid-local, r=Manishearthbors-servo
ir: Make the id local to the context.
2016-11-15ir: Make the id local to the context.Emilio Cobos Álvarez
2016-11-15Auto merge of #255 - emilio:type-alias, r=fitzgenbors-servo
Template alias full and partial specialization improvements. This doesn't completely fix #251, but fixes other related problems. r? @fitzgen
2016-11-15ir: Explicitly discard specialized templated type aliases as already resolved.Emilio Cobos Álvarez
2016-11-14Auto merge of #257 - fitzgen:more-logging-and-asserts, r=emiliobors-servo
Add more logging for item insertion and asserts This adds `debug!` logging for all paths that insert items into `BindgenContext::items`, and adds some `debug_assert!`s against dangling `ItemId`s. r? @emilio
2016-11-14Add more logging for item insertion and assertsNick Fitzgerald
This adds `debug!` logging for all paths that insert items into `BindgenContext::items`, and adds some `debug_assert!`s against dangling `ItemId`s.
2016-11-14Auto merge of #248 - emilio:union-debug-again, r=fitzgenbors-servo
codegen: Always implement debug for __BindgenUnionField. Our debug-detection code assumes so. Fixes #246 r? @fitzgen
2016-11-14Auto merge of #253 - fitzgen:clean-up-type-collector, r=emiliobors-servo
Clean up TypeCollector implementations Rather than making `TypeCollector` implementations recursively call `collect_types` on their subtypes, just gather immediate subtypes into the `ItemSet`. The subtypes' `TypeCollector` implementation will be recursively called by `WhitelistedItemsIter`. This makes it less likely we will "skip" a layer by recursively calling `collect_types` on some subtypes without adding the subtypes themselves to the set. r? @emilio
2016-11-14Auto merge of #254 - fitzgen:warn-when-giving-up-and-assuming-named, r=emiliobors-servo
Warn when giving up and assuming a named type When we fail to parse Clang stuff into our IR and give up, and assume that we are looking at a named template type, we now emit a warning to assist with debugging. r? @emilio
2016-11-14Warn when giving up and assuming a named typeNick Fitzgerald
When we fail to parse Clang stuff into our IR and give up, and assume that we are looking at a named template type, we now emit a warning to assist with debugging.
2016-11-14Clean up TypeCollector implementationsNick Fitzgerald
Rather than making `TypeCollector` implementations recursively call `type_collector` on their subtypes, just gather immediate subtypes into the `ItemSet`. The subtypes' `TypeCollector` implementation will be recursively called by `WhitelistedItemsIter`. This makes it less likely we will "skip" a layer by recursively calling `collect_types` on some subtypes without adding the subtypes themselves to the set.
2016-11-14codegen: Always implement debug for __BindgenUnionField.Emilio Cobos Álvarez
Our debug-detection code assumes so. Fixes #246 r? @fitzgen
2016-11-14Auto merge of #247 - emilio:macro-redef, r=fitzgenbors-servo
Handle macro redefinition a bit more graciously. r? @fitzgen
2016-11-14Auto merge of #245 - emilio:min, r=fitzgenbors-servo
codegen: Special-case i64::MIN since it produces a overflow on aster. Proper fix on aster soon, still worth to get this in I guess. r? @fitzgen
2016-11-14Auto merge of #243 - emilio:include-path, r=fitzgenbors-servo
Fix path detection after #228 r? @fitzgen Too bad we can't test it on CI because CI has the path correctly setup :( Fixes #242
2016-11-14Auto merge of #232 - 11Takanori:124-clang-cursor-referenced-option-cursor, ↵bors-servo
r=emilio clang::Cursor::referenced should return Option<clang::Cursor> Fixes https://github.com/servo/rust-bindgen/issues/124 Since I am new to Rust, I hope I didn't do things too badly
2016-11-14Return Option<Cursor> instead of CursorTakanori Ishibashi
2016-11-13Handle macro redefinition a bit more graciously.Emilio Cobos Álvarez
2016-11-13codegen: Special-case i64::MIN since it produces a overflow on aster.Emilio Cobos Álvarez
Proper fix on aster soon, still worth to get this in I guess. r? @fitzgen
2016-11-13Fix path detection after #228Emilio Cobos Álvarez
r? @fitzgen Fixes #242
2016-11-11Auto merge of #240 - fitzgen:overloads, r=emiliobors-servo
Add support for bindings to overloaded functions This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol. Fixes #239 r? @emilio
2016-11-11Add support for bindings to overloaded functionsNick Fitzgerald
This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol.
2016-11-11Auto merge of #230 - jeanphilippeD:issue_72, r=emiliobors-servo
Use __BindegenComplex for C Complex Fix #72 C complex only exists for floating point types C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
2016-11-11Use __BindegenComplex for C Complex Fix #72Jean-Philippe DUFRAIGNE
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
2016-11-11Auto merge of #238 - fitzgen:disable-osx-travis, r=emiliobors-servo
Disable OSX builds on Travis CI The wait time to get OSX machines on Travis CI is *way* too long at the moment. We'll be able to revert this commit in the future, once Travis CI adds more OSX machines to their cluster, hopefully. r? @emilio
2016-11-11Auto merge of #233 - fitzgen:float128, r=emiliobors-servo
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
2016-11-11Disable OSX builds on Travis CINick Fitzgerald
The wait time to get OSX machines on Travis CI is *way* too long at the moment. We'll be able to revert this commit in the future, once Travis CI adds more OSX machines to their cluster, hopefully.
2016-11-11Add rudimentary support for `__float128`Nick Fitzgerald
This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation.
2016-11-11Auto merge of #235 - emilio:refmt, r=fitzgenbors-servo
Reformat Automatic reformat running `cargo fmt` for the latest nits introduced. r? @fitzgen
2016-11-10Auto merge of #234 - emilio:js-madness, r=fitzgenbors-servo
ir: Search for compound structures when we have unexposed type and base class cursor. And it's not a valid identifier as a template parameter. See the comment and the tests for details. Better ideas for the check appreciated, but I was really sleepy to look for a better solution right now. r? @fitzgen
2016-11-10Auto merge of #237 - fitzgen:using-creduce-with-bindgen, r=emiliobors-servo
Describe how to use `creduce` with `bindgen` This commit extends CONTRIBUTING.md with information on how to use `creduce` to minimize input header test cases that cause `bindgen` to panic, generate bad bindings, or any other incorrectness. r? @emilio
2016-11-10Describe how to use `creduce` with `bindgen`Nick Fitzgerald
This commit extends CONTRIBUTING.md with information on how to use `creduce` to minimize input header test cases that cause `bindgen` to panic, generate bad bindings, or any other incorrectness.
2016-11-11Reformat.Emilio Cobos Álvarez
2016-11-11ir: Search for compound structures when we have unexposed type and base ↵Emilio Cobos Álvarez
class cursor. And it's not a valid identifier as a template parameter. See the comment and the tests for details.
2016-11-10Auto merge of #228 - jdub:clap, r=emiliobors-servo
Clap your hands say yeah! 👏🏻 In progress port to `clap`, obsoletes the `docopt` port in servo/rust-bindgen#202.
2016-11-10Port to clap command line parsingJeff Waugh
2016-11-09Add required Builder methodsJeff Waugh
2016-11-08Auto merge of #219 - emilio:macros, r=fitzgenbors-servo
Parse macro expressions. Clang is trolling me really hard so I'm going to see if the extra token I'm always getting is LLVM 3.9 specific.
2016-11-08Address review comments.Emilio Cobos Álvarez
2016-11-08Add a finer-grane and more generic API for choosing macro types.Emilio Cobos Álvarez
2016-11-08Parse macros with cexpr.Emilio Cobos Álvarez
2016-11-08Auto merge of #226 - emilio:bitfields, r=fitzgenbors-servo
Generate and add options for bitfield-like enums. r? @fitzgen or @Manishearth cc @bholley @upsuper @heycam Followups: * Reduce duplication a bit in that code (probably E-easy) * Generate an impl of `BitOr` for bitfield-like enums (E-easy/E-less-easy).
2016-11-08codegen: Simplify bitfield logic a bit, make it work for unnamed enums, generateEmilio Cobos Álvarez
default BitOr implementation.