summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
AgeCommit message (Collapse)Author
2017-02-17Make an ir::dot module and DotAttributes traitNick Fitzgerald
2017-02-16Rework how bitfields are handled.Emilio Cobos Álvarez
2017-02-15Graphviz implementationArtem Biryukov
2017-02-13Auto merge of #513 - emilio:const-fn-arg, r=fitzgenbors-servo
Use the constness of the inner type when converting array function args. Fixes https://github.com/servo/rust-bindgen/issues/509 I'm actually surprised we had no tests for this.
2017-02-14codegen: Use the constness of the inner type when converting array function ↵Emilio Cobos Álvarez
arguments. Fixes https://github.com/servo/rust-bindgen/issues/509 I'm actually surprised we had no tests for this. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-13Run `cargo fmt`Nick Fitzgerald
2017-02-13Rename WhitelistedItemsIter to ItemTraversalNick Fitzgerald
Also moves it out to its own ir::traversal module, and moves ItemSet to the ir::item module.
2017-02-10ir: Don't parse non-semantic-children cursor as inner structs.Emilio Cobos Álvarez
Fixes: https://github.com/servo/rust-bindgen/issues/482
2017-02-08Run `cargo fmt`Nick Fitzgerald
2017-02-08Rename TypeKind::TemplateRef to TypeKind::TemplateInstantiationNick Fitzgerald
2017-02-08codegen: Fix remaining cases of missing core prefix.Emilio Cobos Álvarez
2017-02-08implement Default traitFlier Lu
2017-02-07codegen: Improve the assertion message of the failing layout tests.Emilio Cobos Álvarez
2017-02-07codegen: Fix the build in older rustc versions.Emilio Cobos Álvarez
2017-02-07add padding bytes to align strctureFlier Lu
2017-02-06Make abi optional for FunctionSigMikko Lehtonen
2017-02-05objc: Support method argumentsMikko Lehtonen
2017-02-03Run `cargo fmt`Nick Fitzgerald
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-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-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-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-23Unify under the `bindgen` name.Emilio Cobos Álvarez
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-14codegen: Always implement debug for __BindgenUnionField.Emilio Cobos Álvarez
Our debug-detection code assumes so. Fixes #246 r? @fitzgen
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-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-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-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-08codegen: Simplify bitfield logic a bit, make it work for unnamed enums, generateEmilio Cobos Álvarez
default BitOr implementation.
2016-11-08Add an option to generate bitfield-like typesafe enums.Emilio Cobos Álvarez