summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-11-14Auto merge of #232 - 11Takanori:124-clang-cursor-referenced-option-cursor, ↵bors-servo
r=emilio clang::Cursor::referenced should return Option<clang::Cursor> Fixes https://github.com/servo/rust-bindgen/issues/124 Since I am new to Rust, I hope I didn't do things too badly
2016-11-14Return Option<Cursor> instead of CursorTakanori Ishibashi
2016-11-13Handle macro redefinition a bit more graciously.Emilio Cobos Álvarez
2016-11-13codegen: Special-case i64::MIN since it produces a overflow on aster.Emilio Cobos Álvarez
Proper fix on aster soon, still worth to get this in I guess. r? @fitzgen
2016-11-13Fix path detection after #228Emilio Cobos Álvarez
r? @fitzgen Fixes #242
2016-11-11Auto merge of #240 - fitzgen:overloads, r=emiliobors-servo
Add support for bindings to overloaded functions This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol. Fixes #239 r? @emilio
2016-11-11Add support for bindings to overloaded functionsNick Fitzgerald
This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol.
2016-11-11Use __BindegenComplex for C Complex Fix #72Jean-Philippe DUFRAIGNE
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
2016-11-11Auto merge of #233 - fitzgen:float128, r=emiliobors-servo
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
2016-11-11Add rudimentary support for `__float128`Nick Fitzgerald
This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation.
2016-11-11Auto merge of #235 - emilio:refmt, r=fitzgenbors-servo
Reformat Automatic reformat running `cargo fmt` for the latest nits introduced. r? @fitzgen
2016-11-11Reformat.Emilio Cobos Álvarez
2016-11-11ir: Search for compound structures when we have unexposed type and base ↵Emilio Cobos Álvarez
class cursor. And it's not a valid identifier as a template parameter. See the comment and the tests for details.
2016-11-10Port to clap command line parsingJeff Waugh
2016-11-09Add required Builder methodsJeff Waugh
2016-11-08Auto merge of #219 - emilio:macros, r=fitzgenbors-servo
Parse macro expressions. Clang is trolling me really hard so I'm going to see if the extra token I'm always getting is LLVM 3.9 specific.
2016-11-08Address review comments.Emilio Cobos Álvarez
2016-11-08Add a finer-grane and more generic API for choosing macro types.Emilio Cobos Álvarez
2016-11-08Parse macros with cexpr.Emilio Cobos Álvarez
2016-11-08codegen: Simplify bitfield logic a bit, make it work for unnamed enums, generateEmilio Cobos Álvarez
default BitOr implementation.
2016-11-08`cargo fmt`.Emilio Cobos Álvarez
2016-11-08Add an option to generate bitfield-like typesafe enums.Emilio Cobos Álvarez
2016-11-08Fix --use-core for functions, since we used the aster helper.Emilio Cobos Álvarez
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-11-07Auto merge of #224 - fitzgen:type-is-valid, r=emiliobors-servo
Add `clang::Type::is_valid` and use it instead of checking self.kind() against CXType_Invalid Needed `is_valid()` when debugging, so figured we should land this and update places where we compare against the magical sentinel value. r? @emilio
2016-11-07Auto merge of #221 - emilio:dont-override-float, r=fitzgenbors-servo
Add an option to avoid converting to f32/f64 automatically float types. This implements another feature that we need for parity with upstream bindgen. r? @fitzgen
2016-11-07Auto merge of #218 - emilio:use-core, r=fitzgenbors-servo
Support --use-core and --ctypes-prefix As requested in https://github.com/Yamakaky/rust-bindgen/issues/400#issuecomment-258632805. r? @fitzgen
2016-11-07Auto merge of #172 - malisas:malisa-semantic-parent-call, r=fitzgen,emiliobors-servo
Make clang::Cursor::fallible_semantic_parent make ffi call This PR fixes #120 . `clang::Cursor::semantic_parent` now just calls `clang::Cursor::fallible_semantic_parent`, and the ffi call has been moved into `fallible_semantic_parent`. This change broke a number of tests which call `is_toplevel()` (which itself calls `semantic_parent()`): > panicked at called Option::unwrap() on a None value So I re-wrote `is_toplevel()` to call `fallible_semantic_parent()`, which returns an `Option<Cursor>` type instead.
2016-11-07Use `clang::Type::is_valid` instead of checking self.kind() against ↵Nick Fitzgerald
CXType_Invalid
2016-11-07Add an option to avoid converting to f32/f64 automatically float types.Emilio Cobos Álvarez
2016-11-07Add `clang::Type::is_valid`Nick Fitzgerald
A helper for checking if the type's kind is not `CXType_Invalid`.
2016-11-07Useful little helpers for Item and TypeNick Fitzgerald
2016-11-07Wrap enum_val_unsigned in an OptionAndrew Fluth
2016-11-06make fallible_semantic_parent do ffi call and validationMalisa Smith
2016-11-06Restore outer conditional.J. Cliff Dyer
2016-11-06Wrap enum_val_signed in an Option.J. Cliff Dyer
Also reorganize calling function to avoid duplicate checking of cursor type. Fixes #127
2016-11-06Remove unused template_arg_kind function.J. Cliff Dyer
2016-11-06bin: Remove unused import.Emilio Cobos Álvarez
2016-11-06bindgen: Support --use-core and --ctypes-prefix.Emilio Cobos Álvarez
2016-11-06Cargo fmtEmilio Cobos Álvarez
2016-11-06Removed template_arg_value method in clang.rsNikhil Shagrithaya
2016-11-05Auto merge of #203 - ajnirp:137-pointee-type, r=emiliobors-servo
change return value of Type::pointee_type() to Option<Type> Fixes #137
2016-11-04change return value of Type::pointee_type() to Option<Type>Rohan Prinja
2016-11-04Don't be loud about ignoring `using` and `static_assert` cursorsNick Fitzgerald
2016-11-04Don't be loud about ignoring macro expansion cursorsNick Fitzgerald
2016-11-04Auto merge of #210 - fitzgen:dangling-item-id-in-partial-specializations, ↵bors-servo
r=emilio Dangling item id in partial specializations See individual commit messages for details. r? @emilio
2016-11-04Use a known-resolved ItemId as a parent in partial specialization childrenNick Fitzgerald
The `with_id` id will potentially end up unused if we find we already have an item (with its own distinct `ItemId`) for the type, so if we pass `with_id` as the parent id when parsing children it is potentially a dangling reference. Instead, use the canonical template declaration as the parent. It is already parsed and has a known-resolvable `ItemId`.
2016-11-04Use a temporary for the return value in IteId::next()Nick Fitzgerald
This adds a temporary binding for the newly allocated id so that we can use it in conditional breakpoints when debugging dangling `ItemId` references. I believe that we will want the ability to set conditional breakpoints in this method every single time we end up debugging dangling references, so it is worth landing in master.
2016-11-04clang::Cursor::definition should return Option<clang::Cursor> — Fixes #123Rémy HUBSCHER
Paired with @glasserc
2016-11-04Auto merge of #205 - Natim:131-cursor-ret-type-return-option-type, r=emiliobors-servo
Make clang::Cursor::ret_type return an Option<Type> — Fixes #131 Well apparently nobody is using `Cursor::ret_type` 😢
2016-11-04Rip it out please.Rémy HUBSCHER