summaryrefslogtreecommitdiff
path: root/src/codegen/derive_debug.rs
AgeCommit message (Collapse)Author
2017-09-22Rename derive_debug → impl_debug.Sergey Pepyakin
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-06Don't try and debug format blacklisted types when generating `impl Debug` blocksNick Fitzgerald
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-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.