summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-03-04codegen: Properly track alignment of unions.Emilio Cobos Álvarez
This makes us not unnecessarily add repr(align) to unions. Closes #1498.
2019-03-04Update default rust target to 1.33.Emilio Cobos Álvarez
Closes #1529.
2019-02-22Work-around https://bugs.llvm.org/show_bug.cgi?id=40813.Emilio Cobos Álvarez
This fixes a crash when using non-deductible auto types.
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-02-03Rework the way that argument types and names are found from function signatures.Porter Smith
This fixes the issue seen in #1500 where function pointers as a return type have their parameters incorrectly generated. This also fixes a broken test case, objc_property_fnptr, as its types are now generated correctly.
2019-02-03ir: Ignore constructors with bogus spellings.Emilio Cobos Álvarez
2019-01-25Produce a more useful error message when rustfmt can't be found. Fixes #1205Ted Mielczarek
Prior to this change bindgen would simply print any error that occurred while attempting to run rustfmt straight to stderr using fmt::Debug. Combined with the fact that rustfmt is enabled by default now this meant that if rustfmt was missing or not working a cryptic error would be printed.
2019-01-18Fix layout with packed class that only has a vtableTom Tromey
I noticed that a `#pragma packed` class that has only a vtable but no data members is not marked repr(packed). The bug is that is_packed examines data members but not the vtable when applying its heuristic.
2019-01-16Document some macros.Emilio Cobos Álvarez
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.
2019-01-01Remove deprecated calls to trim_(right|left)_matchesChristian Legnitto
Fixes https://github.com/rust-lang/rust-bindgen/issues/1480
2018-12-30Log the libclang path.Emilio Cobos Álvarez
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
2018-12-28codegen: ctypes_prefix may not be an ident.Emilio Cobos Álvarez
This fixes a panic uncovered by the proc_macro update, which validates idents now. We were using it as a pretty crappy way to turn it into something that could be turned into a TokenStream. But TokenStream implements FromStr now.
2018-12-24ir: Move a variable to where it's used.Emilio Cobos Álvarez
2018-12-23codegen: We should not iterate over codegen_items.Emilio Cobos Álvarez
This should allow making it a HashSet.
2018-12-23Stop using a BTreeSet to store items.Emilio Cobos Álvarez
We use sequential id's so a Vec<Option<T>> does the trick. This reduces the time for: time ./target/release/bindgen tests/stylo.hpp --no-rustfmt-bindings From ~6s to less than 5s on my machine.
2018-12-23Switch to hashbrown.Emilio Cobos Álvarez
This wins between 2 and 5 milliseconds more in the test-case above, so no reason not to I guess.
2018-12-23Switch to FxHash for hash maps and such.Emilio Cobos Álvarez
This isn't such a massive win as I'd have hoped, but it is consistently faster, so there's no reason not to. > ./bindgen-old tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2>&1 6.17s user 0.84s system 98% cpu 7.079 total > ./target/release/bindgen tests/stylo.hpp --no-rustfmt-bindings > /dev/null 2> 5.92s user 0.87s system 98% cpu 6.866 total Which isn't _that_ much but it's quite a bit.
2018-12-23Allow to turn off the matches recording introduced in #1469.Emilio Cobos Álvarez
2018-12-23regex_set: Avoid allocations in unmatched_items().Emilio Cobos Álvarez
2018-12-23regex_set: Derive Default instead of manually implementing it.Emilio Cobos Álvarez
2018-12-23Merge pull request #1469 from sanxiyn/warn-unused-option. r=emilioEmilio Cobos Álvarez
Warn about unused whitelist options
2018-12-23Add some diagnostics about which clang we find and which flags we derive ↵Emilio Cobos Álvarez
from it.
2018-12-20Warn about unused whitelist optionsSeo Sanghyeon
2018-12-19Store original strings in RegexSetSeo Sanghyeon
2018-12-14ir: Put function attribute detection under an opt-in flag.Emilio Cobos Álvarez
Given it was a considerable performance hit under some workloads. Closes #1465.
2018-12-14clang: Tokenize more lazily.Emilio Cobos Álvarez
Instead of converting all the tokens to utf-8 before-hand, which is costly, and allocating a new vector unconditionally (on top of the one clang already allocates), just do the tokenization more lazily. There's actually only one place in the codebase which needs the utf-8 string, all the others can just work with the byte slice from clang. This should have no behavior change, other than be faster. In particular, this halves the time on my machine spent on the test-case from #1465. I'm not completely sure that this is going to be enough to make it acceptable, but we should probably do it regardless.
2018-12-10User-guide link update on docs.rsRoy Buitenhuis
The link to the user guide pointed to https://rust-lang-nursery.github.io/rust-bindgen/
2018-12-02codegen: Properly detect bindgen unions.Emilio Cobos Álvarez
The root cause of the issue was the missing: ``` self.saw_bindgen_union |= new.saw_bindgen_union; ``` But I also cleaned up a bit more and removed the unused saw_union. Fixes #1457
2018-11-30Update which as well.Emilio Cobos Álvarez
2018-11-30Remove the hack now that rustfmt-nightly properly preserves the comments.Emilio Cobos Álvarez
2018-11-30Use rustfmt's normalize_doc_attributes, to mostly preserve behavior re. doc ↵Emilio Cobos Álvarez
comments.
2018-11-30Update quote and proc-macro.Bastien Orivel
I give up on the doc comments. This is a rebase of #1334 keeping the formatting of the comments and using TokenStream::from_str instead because one can hope. Fixes #1407.
2018-11-30Merge pull request #1452 from emilio/whitelist-nameEmilio Cobos Álvarez
Don't mangle using the parse callbacks for whitelisting / blacklisting / etc.
2018-11-28Add source annotation to express explicit derives for a type.Porter Smith
This allows for explicit selection of which traits are derived for a type, e.g. deriving custom traits on particular types that need it. Example usage: ```C++ /// <div rustbindgen derive="Clone"></div> /// <div rustbindgen derive="MyDerivableTrait"></div> struct foo { ... }; ``` generates into ```Rust #[derive(Clone,MyDerivableTrait)] struct foo { ... } ```
2018-11-28Don't mangle using the parse callbacks for whitelisting / blacklisting / etc.Emilio Cobos Álvarez
2018-11-27Add #[must_use] to functions annotated with __attribute__((warn_unused_result))Porter Smith
2018-11-26callbacks: Allow reporting string macroschrysn
There is no useful action to take on those, but receiving their values (to re-export them as cfg() options) would be helpful right now in integrating with RIOT's build system.
2018-11-13Auto merge of #1444 - scoopr:fix_noisy, r=emiliobors-servo
Fix noisy errors This silences errors from template functions and dependant types.
2018-11-14Fix noisy errorsMikko Lehtonen
This silences errors from template functions and dependant types.
2018-11-13Fix namespaces with macro namesMikko Lehtonen
2018-11-10Auto merge of #1438 - ekse:item_name, r=emiliobors-servo
Add item_name parse callback. Issue: #428
2018-11-10Add item_name parse callback.Sébastien Duquette
2018-11-09Fix unit tests for `--generate functions` argJosh Channings
2018-11-08Fix Builder::command_line_args() --generate typoJosh Channings
Looks like the accepted argument has always been "functions", and this output has always been "function".
2018-11-07Use canonical path for type alias loop detectionSeo Sanghyeon