summaryrefslogtreecommitdiff
path: root/src/codegen
AgeCommit message (Collapse)Author
2017-10-30Need mangle name of fields in struct for impl debugZhiting Zhu
2017-10-28ir: References have no implicit template parameters.Emilio Cobos Álvarez
Fixes #1113.
2017-10-25Compute sizedness with a fixed-point analysisNick Fitzgerald
This fixes a couple bugs where we weren't properly adding an `_address` byte. It also helps pave the way for computing implicit fields (such as padding, `_address`, vtable pointers, etc) in its own pass, before codegen. Fixes #768
2017-10-24Auto merge of #1085 - pepyakin:builtin-clone-impls, r=fitzgenbors-servo
Derive `Clone` along with `Copy` on Rust 1.21 Fixes #934 r? @fitzgen or @emilio
2017-10-24Derive `Clone` along with `Copy` on latest stable.Sergey Pepyakin
2017-10-24Auto merge of #1091 - jrmuizel:linkage, r=emiliobors-servo
Store function linkage in the ir This lets us capture 'static inline' functions in the ir and filter them later down the pipeline. This is the first step on the way to handling these functions better.
2017-10-24Store function linkage in the irJeff Muizelaar
This lets us capture 'static inline' functions in the ir and filter them later down the pipeline. This is the first step on the way to handling these functions better.
2017-10-23Remove `CompInfo::needs_explicit_vtable` and use `HasVtable::has_vtable_ptr` ↵Nick Fitzgerald
instead
2017-10-13Handle unsigned integer constants greater than u32::MAX in codegenNick Fitzgerald
We were not checking signed-ness and emitting the appropriate types. Fixes #1040
2017-10-12Auto merge of #1079 - fitzgen:move-self-into-gen, r=pepyakinbors-servo
Move `self` into `ir::BindgenContext::gen` Small clean up. See each commit for details. r? @pepyakin
2017-10-12Make `ir::BindgenContext::gen` take ownership of `self`Nick Fitzgerald
`bindgen` follows a pipeline architecture, and we only ever generate bindings once. By taking ownership of `self`, we can enforce this. We can also remove checks inside `gen` for whether we have resolved type refs or not, since we now know that we haven't because it is guaranteed to only be called the one time.
2017-10-12Rename `bitfield` to `bitfield_width`Nick Fitzgerald
Its more clear what the methods/fields are returning/storing when we add "width" to the name.
2017-10-11Handle explicit align=1.Sergey Pepyakin
2017-10-11Refactor requires_explicit_alignSergey Pepyakin
2017-10-10Auto merge of #1071 - pepyakin:emit-hex-bitfield-masks, r=fitzgenbors-servo
Emit hex bitfield masks r? @fitzgen
2017-10-10Emit hex bitfield masksSergey Pepyakin
2017-10-10Auto merge of #1065 - liranringel:thiscall, r=fitzgenbors-servo
Add support for the thiscall ABI Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/541 The thiscall ABI is experimental, so in order to use it nightly is required and also the following statement: `#![feature(abi_thiscall)]` That's a problem because the `tests_expectations` crate (in the tests folder) tries to compile it (and stable is required).
2017-10-09Auto merge of #1066 - pepyakin:bitfields-in-unions, r=fitzgenbors-servo
Bitfields in unions Fixes #744 I think it is WIP for the moment as I didn't run tests locally.
2017-10-10Add support for the thiscall ABILiran Ringel
2017-10-09Fix bitfields in bindgen unionsSergey Pepyakin
2017-10-07Tell LLVM to not mangle names if they're already mangled through link_name ↵Liran Ringel
attribute
2017-10-05Use bitfield getter_name in impl_debug.Sergey Pepyakin
Also make impl_partialeq test to also cover impl_debug case.
2017-10-05Use bitfield getter_name in impl_partialeqSergey Pepyakin
2017-10-05Eagerly generate bitfield accessor namesSergey Pepyakin
Also clean a bit.
2017-10-04Remove early anonymous bitfield filtering and consolidate name methodOliver Geller
2017-10-03Assert we only gen partialeq for non rust unionsSergey Pepyakin
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-10-02Tighten up `is_unsized` and `has_vtable` checks to operated on TypeIdNick Fitzgerald
2017-10-02Make methods/constructors/destructors use FunctionIdNick Fitzgerald
And also allow ID comparison across ID types, as this makes implementing the above much easier.
2017-10-02Introduce ModuleId to strongly type IDs pointing at ModulesNick Fitzgerald
2017-10-02A bunch of parsing things should return TypeIdNick Fitzgerald
2017-10-02Make `Enum::repr` into a `TypeId`Nick Fitzgerald
2017-10-02Make base members use TypeId rather than ItemIdNick Fitzgerald
2017-10-02Make a bunch more methods take generic idsNick Fitzgerald
2017-10-02Make comp fields contain `TypeId`sNick Fitzgerald
2017-10-02Make functions which take an ItemId generic to take any kind of idNick Fitzgerald
2017-10-02Make `TypeKind::{Alias,TemplateAlias,Array,Pointer,Reference}` use `TypeId`Nick Fitzgerald
This commit makes certain `TypeKind`s that can only reference other types use `TypeId` instead of `ItemId`.
2017-10-02Turn `build_templated_path` into `build_path`Nick Fitzgerald
None of the callers were passing template parameters.
2017-10-02Remove unused parameter to `codegen::utils::type_from_named`Nick Fitzgerald
2017-10-02Introduce the `TypeId` newtype over `ItemId`Nick Fitzgerald
This commit also makes `BindgenContext::resolve_type` take a `TypeId`, and adds unchecked conversions everywhere that we call it. Next, I'm going to go through the code base, replacing these unchecked conversions with checked ones, and tightening up types as I go.
2017-09-25codegen: Avoid generating wrong type for enums with unknown representations.Emilio Cobos Álvarez
2017-09-22Deanonymize fieldsSergey Pepyakin
Clean. Add timer. Clean codegen
2017-09-22Auto merge of #1016 - pepyakin:impl-debug-fixes, r=fitzgenbors-servo
Impl_debug fixes r? @fitzgen
2017-09-22Rename derive_debug → impl_debug.Sergey Pepyakin
2017-09-22Generate base names upon constructon.Sergey Pepyakin
2017-09-19Derive Ord when possibleSergey Pepyakin
2017-09-19Emit derive(PartialOrd)Sergey Pepyakin
2017-09-14Add a `Builder::blacklist_type`Alexey Zabelin
This deprecates `Builder::hide_type`. Related to #984. - [x] Add Builder::blacklist_type, that does the same thing as hide_type - [x] Mark Builder::hide_type as #[deprecated = "Use blacklist_type instead"] - [x] Make hide_type delegate to blacklist_type - [x] Rename the BindgenOptions::hidden_types member to BindgenOptions::blacklisted_types - [x] Rename ir::context::BindgenContext::hidden_by_name to blacklisted_by_name - [x] Rename ir::item::Item::is_hidden to is_blacklisted
2017-09-11Make bindgen generate enums as constants by defaultCldfire
Also simplifies the logic that determines which enum variation gets chosen.
2017-09-07Use the `quote!` macro for `link_name` attributesNick Fitzgerald
The latest `rustfmt` has fixed the formatting bugs we were running into.