summaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2020-04-27Run `cargo fmt`Joshua Nelson
2020-04-27Run `cargo fix --edition`Joshua Nelson
2020-03-25Indicate undefined behaviour in enum docs and point to alternativeAphek
2020-03-16Added some initial constraints to the objective-c bindgen stuffSebastian Imlay
2020-02-03options: Add an opt-in to recover the size_t behavior removed in 5d38f2ac.Emilio Cobos Álvarez
2020-02-02ir: codegen: Handle too large bitfield units.Emilio Cobos Álvarez
By not generating various code for it. In the future, we could improve on this by splitting contiguous bitfield units, if needed, so that we can implement them without dealing with rust array derive limits. Fixes #1718
2020-01-13codegen: Max guaranteed alignment is 8 (with u64), not target pointer width.Emilio Cobos Álvarez
2020-01-13Remove padding for over-aligned structs when we support repr(align).Emilio Cobos Álvarez
Before repr(align), we could only safely guarantee up to 8-bytes of alignment (I think the pointer-width check is a more conservative way of doing that, in practice, because I _think_ u64 is 8-byte aligned even for smaller targets). So when we may generate a potentially-under-aligned struct, we always used to pad it so as to guarantee that at least the size (and thus reads from rust for C-allocated structs) was fine. But if we support repr(align), then the above is always unneeded.
2020-01-05An initial implementation of objective-c generics for #1259 (#1702)simlay
2019-12-16Remove deprecated Error::descriptionKornel
2019-12-13Remove size_t to usize conversion ruleConor McAvity
2019-12-11codegen: Minor cleanup after #1691.Emilio Cobos Álvarez
2019-12-11Add support for wasm_import_moduleJasper-Bekkers
2019-11-28Fix warning on rustdocJake Merdich
Rustdoc was treating doc comments containing `#[non_exhaustive]` as links and warning, so mark that as code to avoid the warning.
2019-11-14Make rustfmt happyDavid Vo
2019-11-14Add newtype enum styleDavid Vo
This adds an enum style similar to the existing bitfield style, without the bitwise operator impls. Closes: #1669
2019-11-09Replace unsafe ref->ptr transmute with 'as' castingElichai Turkel
2019-11-08Option to use #[repr(transparent)] structs instead of type aliasing.Joseph Rafael Ferrer
2019-11-08Add support for MaybeUninitElichai Turkel
2019-11-03Do not generate implementation for clone for FAMDavid Frey
Flexible array members are represented in the generated binding by a struct __IncompleteArrayField<T>. Since such members do not contain any information about how big they are, it is impossible to automatically clone or copy them, either in C or rust. Fixes #1431.
2019-10-22codegen: Handle opaque aliases to enums correctly.Emilio Cobos Álvarez
Opaque types don't use the path to their aliased type but an opaque type like an array or primitive with the right alignment. Fixes #1599.
2019-10-14Rustfmt to account for rebase.Emilio Cobos Álvarez
2019-10-08Fix BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit.Cameron McCormack
Fixes #1639.
2019-10-03Use c_void from core when --use-core is specifiedKyle Tomsic
`c_void` is available as `::std::os::raw::c_void` and `::core::ffi::c_void`. If the "--use-core" option is specified (but no --ctypes-prefix is provided), we should emit `::core::ffi::c_void` rather than the `std` one.
2019-09-17Rustfmt.Emilio Cobos Álvarez
2019-07-27Fix beta build warnings / errors. (#1603)Emilio Cobos Álvarez
Fixes #1598
2019-07-24Cleanup wchar_t layout computation to happen later. (#1596)Emilio Cobos Álvarez
This is a breaking cheange since WChar is exposed, but should be no behavior change otherwise.
2019-06-12Style fixes.uk
See https://github.com/rust-lang/rust-bindgen/pull/1575
2019-06-11Add rust target configuration for feature #1554uk
Will panic if the feature is being used outside nightly. See https://github.com/rust-lang/rust-bindgen/pull/1575#discussion_r292231027
2019-06-11Rename a couple miscalled identifiers.uk
See https://github.com/rust-lang/rust-bindgen/pull/1575
2019-06-10Add support for non_exhaustive rustified enums.uk
Implements the feature discussed in https://github.com/rust-lang/rust-bindgen/issues/1554.
2019-06-06For rust-target >= 1.30, make __IncompleteArrayField::new a const fnColin Wallace
2019-06-06For rust-target >= 1.30, make __BindgenUnionField::new a const fnColin Wallace
2019-06-06FIX #1571: For rust-target >= 1.30, make __BindgenBitfieldUnit::new a const fnColin Wallace
2019-06-06Remove the parameter bounds for __BindgenBitfieldUnit::newColin Wallace
This will enable `new` to be changed to a `const fn` in a future patch: `const fn`s do not support trait bounds.
2019-05-22Added array pointers to the CLIElichai Turkel
2019-05-22Added array pointers codegenElichai Turkel
2019-05-21Update LinksAlex Touchet
2019-05-15Only emit #[link_name] attribute if necessary.Michael Woerister
2019-05-06Remove unused mut.Emilio Cobos Álvarez
2019-04-26Remove redundant imports.Emilio Cobos Álvarez
2019-03-25ir: Whitelist items that don't generate code to improve derive behavior.Emilio Cobos Álvarez
When not whitelisting recursively. Fixes #1454
2019-03-21Unify derive logicJethro Beekman
2019-03-04codegen: Properly track alignment of unions.Emilio Cobos Álvarez
This makes us not unnecessarily add repr(align) to unions. Closes #1498.
2019-02-11fix one argument block pointer issue, #1378Flier Lu
2019-02-04codegen: Append implicit template parameters to base members.Emilio Cobos Álvarez
Fixes #1514
2019-01-08Support #[repr(packed(N))] on Rust 1.33+Christian Legnitto
Fixes https://github.com/rust-lang/rust-bindgen/issues/537.
2019-01-03Bitfield enums use #[repr(transparent)] on Rust 1.28+Christian Legnitto
Fixes https://github.com/rust-lang/rust-bindgen/issues/1474.
2018-12-29Merge pull request #1473 from emilio/hashEmilio Cobos Álvarez
Some perf tweaks
2018-12-28codegen: Make zero-sized arrays affect alignment.Emilio Cobos Álvarez
Fixes #684