Age | Commit message (Collapse) | Author | |
---|---|---|---|
2016-11-08 | Fix --use-core for functions, since we used the aster helper. | Emilio Cobos Álvarez | |
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com> | |||
2016-11-07 | Auto merge of #221 - emilio:dont-override-float, r=fitzgen | bors-servo | |
Add an option to avoid converting to f32/f64 automatically float types. This implements another feature that we need for parity with upstream bindgen. r? @fitzgen | |||
2016-11-07 | Add an option to avoid converting to f32/f64 automatically float types. | Emilio Cobos Álvarez | |
2016-11-06 | bindgen: Support --use-core and --ctypes-prefix. | Emilio Cobos Álvarez | |
2016-11-01 | Use `BindgenContext::whitelisted_items` in code generation | Nick Fitzgerald | |
This replaces the manual gathering and traversal of the transitive closure of whitelisted items with the new canonical method. | |||
2016-11-01 | Manual fixups, some of them pretty lame, and don't let rustfmt rewrap comments. | Emilio Cobos Álvarez | |
2016-11-01 | Run `cargo fmt`. | Emilio Cobos Álvarez | |
2016-10-31 | Move the `TypeCollector` trait to the `ir` module | Nick Fitzgerald | |
This commit moves the `TypeCollector` trait out from the `codegen` module and into its own submodule in `ir::type_collector`. Additionally, it puts the various `TypeCollector` trait implementations next to the types that each implementation is for. | |||
2016-10-24 | Add `#![deny(missing_docs)]` | Nick Fitzgerald | |
This commit adds the `#![deny(missing_docs)]` pragma, which causes compilation to fail if a public type or function is missing a documentation comment. It also adds missing documentation comments for public types and functions that were missing them. | |||
2016-10-23 | Auto merge of #110 - heycam:stable-gen-names, r=emilio | bors-servo | |
Give vtables and anonymous items more stable generated names (fixes #60) r? @emilio This works pretty well. There are two remaining things in stylo's structs files that have identifiers that look like they won't be that stable: the anonymous enum for the NODE_* flags at the top level, and the `typedef union { ... } nsStyleUnion`. There are various anonymous enums and other things at the top level in system headers that cause these identifiers to have generated IDs in them higher than 1 and 2. Probably for anonymous enums we could just avoid generating a rust enum altogether, since having the static consts should be sufficient. I tried to mess with the codegen to automatically treat `typedef union { ... } nsStyleUnion` like `union nsStyleUnion { ... }` but it seems the way clang exposes the typedef and union are as two adjacent cursors rather than a parent-child relationship, so it's not so easy. | |||
2016-10-23 | Give vtables and anonymous items more stable generated names. | Cameron McCormack | |
2016-10-21 | Auto merge of #66 - emilio:const-methods, r=nox | bors-servo | |
Take pointer constness into account, to fix generation of const methods. We signal method constness in the `this` pointer creating a `const` pointer, but the `to_rust_ty` implementation never checked that. | |||
2016-10-19 | codegen: Generate constants names for unnamed enums in classes. | Emilio Cobos Álvarez | |
2016-10-18 | Ignore doctests that are really C++ code samples, or aren't meant to run | Nick Fitzgerald | |
2016-10-18 | ir: Handle templated aliases. | Emilio Cobos Álvarez | |
2016-09-27 | Take pointer constness into account, to fix generation of const methods. | Emilio Cobos Álvarez | |
2016-09-26 | Fix review comment. Fix #47 | Jean-Philippe DUFRAIGNE | |
2016-09-25 | Handle re-declaration of a global variable. Fix #48 | Jean-Philippe DUFRAIGNE | |
2016-09-23 | Use the upstreamed version of the array builder. | Emilio Cobos Álvarez | |
2016-09-23 | Union support. | Emilio Cobos Álvarez | |
2016-09-22 | Represent block pointers as *mut c_void instead. | Emilio Cobos Álvarez | |
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com> | |||
2016-09-21 | Add Int128 types. | Emilio Cobos Álvarez | |
2016-09-21 | Some fixes for function pointers, typedefs, and OSX's stdlib.h. | Emilio Cobos Álvarez | |
2016-09-16 | Rewrite the core of the binding generator. | Emilio Cobos Álvarez | |
TL;DR: The binding generator is a mess as of right now. At first it was funny (in a "this is challenging" sense) to improve on it, but this is not sustainable. The truth is that the current architecture of the binding generator is a huge pile of hacks, so these few days I've been working on rewriting it with a few goals. 1) Have the hacks as contained and identified as possible. They're sometimes needed because how clang exposes the AST, but ideally those hacks are well identified and don't interact randomly with each others. As an example, in the current bindgen when scanning the parameters of a function that references a struct clones all the struct information, then if the struct name changes (because we mangle it), everything breaks. 2) Support extending the bindgen output without having to deal with clang. The way I'm aiming to do this is separating completely the parsing stage from the code generation one, and providing a single id for each item the binding generator provides. 3) No more random mutation of the internal representation from anywhere. That means no more Rc<RefCell<T>>, no more random circular references, no more borrow_state... nothing. 4) No more deduplication of declarations before code generation. Current bindgen has a stage, called `tag_dup_decl`[1], that takes care of deduplicating declarations. That's completely buggy, and for C++ it's a complete mess, since we YOLO modify the world. I've managed to take rid of this using the clang canonical declaration, and the definition, to avoid scanning any type/item twice. 5) Code generation should not modify any internal data structure. It can lookup things, traverse whatever it needs, but not modifying randomly. 6) Each item should have a canonical name, and a single source of mangling logic, and that should be computed from the inmutable state, at code generation. I've put a few canonical_name stuff in the code generation phase, but it's still not complete, and should change if I implement namespaces. Improvements pending until this can land: 1) Add support for missing core stuff, mainly generating functions (note that we parse the signatures for types correctly though), bitfields, generating C++ methods. 2) Add support for the necessary features that were added to work around some C++ pitfalls, like opaque types, etc... 3) Add support for the sugar that Manish added recently. 4) Optionally (and I guess this can land without it, because basically nobody uses it since it's so buggy), bring back namespace support. These are not completely trivial, but I think I can do them quite easily with the current architecture. I'm putting the current state of affairs here as a request for comments... Any thoughts? Note that there are still a few smells I want to eventually re-redesign, like the ParseError::Recurse thing, but until that happens I'm way happier with this kind of architecture. I'm keeping the old `parser.rs` and `gen.rs` in tree just for reference while I code, but they will go away. [1]: https://github.com/Yamakaky/rust-bindgen/blob/master/src/gen.rs#L448 |