summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-02-02Added catch_unwind to catch panic at generator due to missing or incorrect flagsJeffrey Deng
2017-02-02Auto merge of #443 - scoopr:objc, r=emiliobors-servo
Add initial Objective C support Hi! I made an attempt to support parsing objective c headers. This is very much incomplete, and likely not quite yet ready for merging, but I thought I'd share the progress so far. Comments appreciated, I'm still very much a newbie in just about everything related to this change (rust as a language, rust ast, libclang, rust-bindgen), and there were many parts of code I wasn't quite sure about. Commit message: It parses interfaces and protocol but ignores base classes, methods that don’t have arguments, the arguments are currently ignored. Also you can pass objc class instances to C functions. Next steps are inheritance/base classes, method signatures, properties, categories. Then check with system headers what is missing.
2017-02-02ir: Fix is_in_non_fully_specialized_template check.Emilio Cobos Álvarez
Fixes https://github.com/servo/rust-bindgen/issues/462
2017-01-31Add initial Objective C supportMikko Lehtonen
It parses interfaces and protocol but ignores base classes, and their methods which don’t have arguments, the method signature is currently ignored. Also you can pass objc class instances to C functions. Next steps are inheritance/base classes, method signatures, properties, categories. Then check with system headers what is missing.
2017-01-30ir: Cleanup name duplication in aliases and named types.Emilio Cobos Álvarez
It's just dumb.
2017-01-30codegen: ignore aliases for decltypes we can't resolve.Emilio Cobos Álvarez
We do the same for template parameters with `typename` on aliases. This is not great, but it's better than generating invalid code.
2017-01-30Force copy for incomplete arrays.Emilio Cobos Álvarez
These aren't extremely great, since this usually requires extra bookkeeping. But C allows it, so let's keep the same semantics.
2017-01-29extract unsafe ZeroedSizeArray traitFlier Lu
2017-01-28generate helper class to access incomplete arrayFlier Lu
2017-01-28treat incomplete array as zero length arrayFlier Lu
fix issue #455
2017-01-27Remove recently-added assertion pending investigation.Emilio Cobos Álvarez
This fails under BaseErrorResult in Stylo builds. I have no idea right now why that isn't whitelisted (should be, given we're calling it from TErrorResult's code generation). Let's disable this pending further investigation since I don't have time to dig into it right now.
2017-01-27codegen: Derive stuff in forward declarations.Emilio Cobos Álvarez
So Rust is happy when you use them in template parameters, since the Derive implementations can't catch this otherwise.
2017-01-26Assert that if we generating code for an item, than it is whitelistedNick Fitzgerald
This is a useful debugging tool for us to catch when code generation and whitelisting have different understandings of the world.
2017-01-26Trace constructors in CompInfo's TypeCollector implNick Fitzgerald
Fixes #447
2017-01-26ir: Allow whitelisting non-recursivelyv0.20.3Emilio Cobos Álvarez
Fixes #429
2017-01-26codegen: Add an option to skip comment generation.Emilio Cobos Álvarez
This is mostly a work around https://github.com/servo/rust-bindgen/issues/426, until we implement the proper fix.
2017-01-26Auto merge of #370 - cynicaldevil:detect-forward, r=emiliobors-servo
Forward declared structs now generate opaque enums @emilio : I checked the test outputs again, and it seems that these changes are affecting struct *definitions* as well. Hence, I have not committed the test changes yet. Fixes #62
2017-01-26Forward declared structs now generate opaque enumsNikhil Shagrithaya
2017-01-24Auto merge of #437 - emilio:constify-all-enums, r=fitzgenbors-servo
codegen: Respect original repr for bitfield-like enums, add a constifying variant. r? @fitzgen Fixes #430
2017-01-24Auto merge of #434 - emilio:no-derive-debug, r=fitzgenbors-servo
Honor and expose the derive_debug option. Fixes #432 r? @fitzgen
2017-01-24Auto merge of #436 - emilio:fix-ns-typedef, r=fitzgenbors-servo
codegen: Fix typedef re-export in namespaces when bindings aren't at the root.
2017-01-24Honor and expose the derive_debug option.Emilio Cobos Álvarez
Fixes #432
2017-01-24codegen: Respect original repr for bitfield-like enums, add a constifying ↵Emilio Cobos Álvarez
variant.
2017-01-24codegen: don't generate extra use statements for non-enums.Emilio Cobos Álvarez
There's just no advantage in doing so.
2017-01-24Make it work in rust stable, and incidentally fix #425Emilio Cobos Álvarez
The problem with #425 was the following: We were parsing the methods after reaching the JS::Value definition. Those methods contained a JSWhyMagic that we hadn't seen, so we parsed it as being in the JS:: module.
2017-01-24codegen: Factor out some bits of root_import.Emilio Cobos Álvarez
2017-01-24codegen: Fix typedef re-export in namespaces when bindings aren't at the root.Emilio Cobos Álvarez
2017-01-24Minor documentation changesjethrogb
2017-01-23Remove now unnecessary FIXMENick Fitzgerald
We trace all things in the vtable via tracing the base types.
2017-01-23Trace all variants of TypeKindNick Fitzgerald
2017-01-23Document why we shouldn't be tracing module -> child edgesNick Fitzgerald
2017-01-23Trace methods in CompInfo's TypeCollector implNick Fitzgerald
Fixes #410
2017-01-23Unify under the `bindgen` name.Emilio Cobos Álvarez
2016-12-09Use a shared workspace for bindgen, libbindgen, and test_expectationsNick Fitzgerald
2016-12-06Add an API to decide what gets generated more granularly.Emilio Cobos Álvarez
2016-11-24Add a new disable-name-namespacing option.Emilio Cobos Álvarez
2016-11-15Add an option to emit our ir for debuggingNick Fitzgerald
Similar to our ability to emit the clang AST, this adds an option to emit our IR for debugging purposes.
2016-11-16Transition to libbindgen sub-crateJeff Waugh
- The root crate is the `bindgen` binary - Rust-ify the test suite, no more subprocesses! - Update Travis config to test both crates
2016-11-15ir: Make the id local to the context.Emilio Cobos Álvarez
2016-11-15Auto merge of #255 - emilio:type-alias, r=fitzgenbors-servo
Template alias full and partial specialization improvements. This doesn't completely fix #251, but fixes other related problems. r? @fitzgen
2016-11-15ir: Explicitly discard specialized templated type aliases as already resolved.Emilio Cobos Álvarez
2016-11-14Add more logging for item insertion and assertsNick Fitzgerald
This adds `debug!` logging for all paths that insert items into `BindgenContext::items`, and adds some `debug_assert!`s against dangling `ItemId`s.
2016-11-14Auto merge of #248 - emilio:union-debug-again, r=fitzgenbors-servo
codegen: Always implement debug for __BindgenUnionField. Our debug-detection code assumes so. Fixes #246 r? @fitzgen
2016-11-14Auto merge of #253 - fitzgen:clean-up-type-collector, r=emiliobors-servo
Clean up TypeCollector implementations Rather than making `TypeCollector` implementations recursively call `collect_types` on their subtypes, just gather immediate subtypes into the `ItemSet`. The subtypes' `TypeCollector` implementation will be recursively called by `WhitelistedItemsIter`. This makes it less likely we will "skip" a layer by recursively calling `collect_types` on some subtypes without adding the subtypes themselves to the set. r? @emilio
2016-11-14Warn when giving up and assuming a named typeNick Fitzgerald
When we fail to parse Clang stuff into our IR and give up, and assume that we are looking at a named template type, we now emit a warning to assist with debugging.
2016-11-14Clean up TypeCollector implementationsNick Fitzgerald
Rather than making `TypeCollector` implementations recursively call `type_collector` on their subtypes, just gather immediate subtypes into the `ItemSet`. The subtypes' `TypeCollector` implementation will be recursively called by `WhitelistedItemsIter`. This makes it less likely we will "skip" a layer by recursively calling `collect_types` on some subtypes without adding the subtypes themselves to the set.
2016-11-14codegen: Always implement debug for __BindgenUnionField.Emilio Cobos Álvarez
Our debug-detection code assumes so. Fixes #246 r? @fitzgen
2016-11-14Auto merge of #247 - emilio:macro-redef, r=fitzgenbors-servo
Handle macro redefinition a bit more graciously. r? @fitzgen
2016-11-14Auto merge of #245 - emilio:min, r=fitzgenbors-servo
codegen: Special-case i64::MIN since it produces a overflow on aster. Proper fix on aster soon, still worth to get this in I guess. r? @fitzgen
2016-11-14Auto merge of #243 - emilio:include-path, r=fitzgenbors-servo
Fix path detection after #228 r? @fitzgen Too bad we can't test it on CI because CI has the path correctly setup :( Fixes #242