summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-29Merge pull request #1043 from clippered/issue-1037/csmith_driver_deriveNick Fitzgerald
Issue #1037: pass all derive-enabling flags in bindgen for csmith driver
2017-09-27Issue #1037: pass all derive-enabling flags in bindgen for csmith driverKC
2017-09-26Auto merge of #1039 - fitzgen:more-docs, r=emiliobors-servo
book: Clean up the C++ section some more Trying to set expectations for what we can do with C++ a little better. r? @emilio
2017-09-26book: Clean up the C++ section some moreNick Fitzgerald
Trying to set expectations for what we can do with C++ a little better.
2017-09-25Auto merge of #1035 - fitzgen:csmith-tweaks, r=pepyakinbors-servo
Csmith tweaks r? @e00E or @emilio or @pepyakin whoever wants to get here first ;)
2017-09-25C-Smith: compile bindings and execute layout testsNick Fitzgerald
This makes us fall over flat on our faces almost immediately...
2017-09-25C-Smith: use temp files instead of local filesNick Fitzgerald
This allows us to have multiple processes generating C files with C-Smith and testing them on bindgen without stepping on each others' toes.
2017-09-25Auto merge of #1022 - harlanhaskins:rustfmt-by-default, r=fitzgenbors-servo
Enable --rustfmt-bindings by default This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables formatting by default. If rustfmt is not accessible, a warning is printed and the bindings are printed unformatted. Addresses #977.
2017-09-25Auto merge of #1030 - emilio:repr, r=fitzgenbors-servo
codegen: Avoid generating wrong type for enums with unknown representation Fixes #1025
2017-09-25Auto merge of #1033 - e00E:csmith-fuzz, r=fitzgenbors-servo
csmith fuzzing ref #969 An initial version of a script that fuzzes bindgen with csmith. I ran it for maybe 1000 iterations and it did not find something wrong. The programs generated by csmith are probably too simple type wise. Here is an example output of what csmith generates: ``` C /* --- Struct/Union Declarations --- */ union U2 { uint64_t f0; const signed f1 : 18; }; union U4 { const volatile signed f0 : 1; volatile int16_t f1; int32_t f2; int8_t * const f3; volatile int64_t f4; }; union U5 { const int8_t * f0; volatile int8_t f1; uint16_t f2; unsigned f3 : 22; }; /* --- GLOBAL VARIABLES --- */ static int8_t g_3[8] = {0x47L,0xE8L,0x47L,0x47L,0xE8L,0x47L,0x47L,0xE8L}; static int32_t g_25 = 0x3421AD7BL; static union U5 g_40 = {0};/* VOLATILE GLOBAL g_40 */ static int32_t g_43[4][3] = {{(-10L),(-10L),(-10L)},{(-10L),(-10L),(-10L)},{(-10L),(-10L),(-10L)},{(-10L),($static int32_t * volatile g_42 = &g_43[0][0];/* VOLATILE GLOBAL g_42 */ static int32_t * volatile g_50 = &g_43[2][0];/* VOLATILE GLOBAL g_50 */ static int32_t g_53 = (-9L); static union U4 g_57 = {0x9C113E7BL};/* VOLATILE GLOBAL g_57 */ /* --- FORWARD DECLARATIONS --- */ static union U4 func_1(void); static int16_t func_4(int32_t p_5); static int32_t func_6(int32_t p_7, union U2 p_8, int8_t * p_9); static int32_t func_10(uint32_t p_11, int8_t * p_12, int8_t * p_13); static int8_t * func_14(int32_t p_15, union U2 p_16); static union U2 func_28(const uint64_t p_29, int8_t * p_30, uint32_t p_31); static union U5 func_34(uint32_t p_35); ```
2017-09-25Auto merge of #1031 - emilio:warn-stderr, r=fitzgenbors-servo
lib: Print warnings to stderr instead of stdout. Seems like the right thing to do, and allows me to test stuff piping to rustc instead of saving to a file.
2017-09-25Auto merge of #1026 - alexeyzab:fix-compiling-expectations-macos, r=fitzgenbors-servo
Make objc-related expectations compile Fixes #1004. After looking at how `msg_send!` is supposed to be used, I realized that we were erroneously passing type signatures to it. The expectations compile now, but some of them are not formatted properly. My guess is that `rustfmt` does not know how to format the following: ``` msg_send!(obj, arg1:1 arg2:2 arg3:3) ``` Notice the lack of separatros between the `arg`s. Any advice on how to proceed here is appreciated. r? @fitzgen
2017-09-25Auto merge of #1024 - AndrewGaspar:dump_preprocessed_input_windows, r=fitzgenbors-servo
Always check out test headers and expectations as LF Addresses #1023. The line endings accidentally don't matter for the majority of the tests because we pass both the generated .rs files and expectations .rs files through rustfmt, which normalizes the line endings to LF. But this change makes it explicit that we expect to test against files with LF line endings.
2017-09-25lib: Print warnings to stderr instead of stdout.Emilio Cobos Álvarez
2017-09-25csmith fuzzinge
2017-09-25codegen: Avoid generating wrong type for enums with unknown representations.Emilio Cobos Álvarez
2017-09-24Auto merge of #1020 - fitzgen:faq, r=emiliobors-servo
Create an FAQ section in the book I feel like we've had to anwer these questions multiple times... Good to be able to just point people to these canonical answers instead of repeating ourselves. r? @emilio
2017-09-24Auto merge of #1005 - fitzgen:some-little-deriving-cleanups, r=emiliobors-servo
Some little deriving cleanups See each commit for details. r? @emilio
2017-09-23Make objc-related expectations compileAlexey Zabelin
WIP, fixes #1004. After looking at how `msg_send!` is supposed to be used, I realized that we were erroneously passing type signatures to it. The expectations compile now, but some of them are not formatted properly. My guess is that `rustfmt` does not know how to format the following: ``` msg_send!(obj, arg1:1 arg2:2 arg3:3) ``` Notice the lack of separatros between `arg`s.
2017-09-22Always check out test headers and expectations as LFAndrew Gaspar
2017-09-22Auto merge of #1021 - pepyakin:deanonymize-fields, r=fitzgenbors-servo
Deanonymize fields r? @fitzgen
2017-09-22Deanonymize fieldsSergey Pepyakin
Clean. Add timer. Clean codegen
2017-09-22Enable --rustfmt-bindings by defaultHarlan Haskins
This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables formatting by default. If rustfmt is not accessible, a warning is printed and the bindings are printed unformatted.
2017-09-22Auto merge of #1016 - pepyakin:impl-debug-fixes, r=fitzgenbors-servo
Impl_debug fixes r? @fitzgen
2017-09-22Auto merge of #1014 - pepyakin:generate-base-names, r=fitzgenbors-servo
Generate base names upon construction As per https://github.com/rust-lang-nursery/rust-bindgen/pull/1012#discussion_r140378893 r? @fitzgen
2017-09-22Create an FAQ section in the bookNick Fitzgerald
I feel like we've had to anwer these questions multiple times... Good to be able to just point people to these canonical answers instead of repeating ourselves.
2017-09-22Fix condition in command_line_flags for impl_debugSergey Pepyakin
2017-09-22Rename derive_debug → impl_debug.Sergey Pepyakin
2017-09-22Generate base names upon constructon.Sergey Pepyakin
2017-09-21Auto merge of #1010 - pepyakin:add-chat-in-readme, r=fitzgenbors-servo
Add links to `impl period` blog post and gitter.im r? @fitzgen
2017-09-21Auto merge of #1008 - AndrewGaspar:underscore-identifier, r=fitzgenbors-servo
Translate _ as __ This change treats _ as a reserved identifier to resolve the bug reported in #631. I have one concern - if the header has both an `_` and `__` identifier in the global namespace, this will cause a conflict. However, it seems like we already don't handle that case for `keyword_` (e.g. `abstract_`, `alignof_`, etc.) so it doesn't seem like we need a solution specifically for `__` in this change. Fixes #631.
2017-09-21Add links to `impl period` blog post and gitter.imSergey Pepyakin
2017-09-20Translate _ as __Andrew Gaspar
2017-09-20Clean up comments about the `Can[Trivially]Derive*` traitsNick Fitzgerald
The whole "should be a no-op" thing isn't really true for all of the traits, especially in the face of black listing. Also further expounded on the differences between the trivial versions and normal versions.
2017-09-20Common method for whether function pointers can trivially derive traitsNick Fitzgerald
Again, this logic was getting copied all over the place, and it is nice to have a single canonical definition.
2017-09-20Factor array size vs Rust derive limit checking into a common methodNick Fitzgerald
We were copying it around and it will be easier if it is defined in one place.
2017-09-20Clean up some derive-related commentsNick Fitzgerald
Changing "partialeq" and "partialord" into "`PartialEq`" and "`PartialOrd`" where it makes sense.
2017-09-20Auto merge of #1001 - aeleos:master, r=fitzgenbors-servo
Ensure all derive analyses check array limit on bitfields Fixes #982 r? @fitzgen
2017-09-19Add large bitfield derive test and fix missing limitOliver Geller
2017-09-19Ensure all derive analyses check array limit on bitfieldsOliver Geller
2017-09-19Auto merge of #996 - alexeyzab:add-no-partialeq-command, r=fitzgenbors-servo
Add --no-partialeq <regex> flag Related to #965. - [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set). - [x] A Builder method to add strings to that RegexSet. - [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method. - [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id). - [x] Tests! - [x] When the no-partialeq type is transitively referenced by a whitelisted item - [x] When the no-partialeq type is explicitly whitelisted - [x] When the no-partialeq type is marked opaque This is my first pass at implementing this functionality, I haven't implemented the tests yet. I wanted to make sure I am on the right track, particularly when it comes to updating `MonotoneFramework::constrain`. r? @fitzgen
2017-09-19Add --no-partialeq <regex> flagAlexey Zabelin
- [x] Add a new RegexSet member to bindgen::Builder (similar to the whitelisted_types set). - [x] A Builder method to add strings to that RegexSet. - [x] Plumbing in src/options.rs to convert --no-partialeq <regex> CLI flags into invocations of the builder method. - [x] Make the MonotoneFramework::constrain function in src/ir/analysis/derive_partialeq.rs check if the given item is explicitly marked not to be Partialeq, and if so, insert it into the self.cannot_derive_partialeq set via return self.insert(id). - [x] Tests! - [x] When the no-partialeq type is transitively referenced by a whitelisted item - [x] When the no-partialeq type is explicitly whitelisted - [x] When the no-partialeq type is marked opaque Fixes #965
2017-09-19Auto merge of #1003 - pepyakin:derive-ord-when-possible, r=fitzgenbors-servo
Derive ord when possible Fixes #884 r? @fitzgen
2017-09-19Fix panic on has_float None unwrapSergey Pepyakin
2017-09-19Clean.Sergey Pepyakin
2017-09-19Add --with-derive-ord to some testsSergey Pepyakin
2017-09-19Derive Ord when possibleSergey Pepyakin
2017-09-19Auto merge of #1002 - pepyakin:derive-partialord-when-possible, r=fitzgenbors-servo
Derive PartialOrd when possible Fixes #882 r? @fitzgen
2017-09-19Add --with-derive-partialord for some testsSergey Pepyakin
2017-09-19Rename deriver_partial_eq_or_partial_ord.Sergey Pepyakin