summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-02Assert that we do not infinitely loop in ir::Item::name_targetNick Fitzgerald
This re-uses the infrastructure used when asserting that `ItemAncestorsIter` does not infinitely loop in `ir::Item::name_target`.
2016-12-02Assert that we won't infinite loop in ItemAncestorsIterNick Fitzgerald
In non-release builds with debug assertions, keep track of the set of `ItemId`s that we have iterated over in `ItemAncestorsIter` and make sure that we don't reach an ancestor we have already yielded, which would trigger an infinite loop.
2016-12-02Do not treat parent struct as a module for nested structsNick Fitzgerald
This fixes `ItemCanonicalPath` to return paths of the form `[module*, item]` rather than `[item*, item]`. That is, there will only be module names before the item's name, rather than also other arbitrary item names (such as parent structs). Fixes #311
2016-12-02Auto merge of #309 - fitzgen:use-root-relative, r=emiliobors-servo
Use the generated root module via a relative path We previously generated uses of the root module with absolute paths: use root; However this only works if the generated bindings are the root of the crate. If they were in some submodule then that path would not be valid. They are now generated relative to the current module, like this: use self::super::super::root; Fixes #96 r? @emilio
2016-12-02Use the generated root module via a relative pathNick Fitzgerald
We previously generated uses of the root module with absolute paths: use root; However this only works if the generated bindings are the root of the crate. If they were in some submodule then that path would not be valid. They are now generated relative to the current module, like this: use self::super::super::root; Fixes #96
2016-12-02Auto merge of #307 - impowski:naming_methods_unify, r=fitzgenbors-servo
Unify naming methods into a single method + options builder type Some of these changes are still under the question but I guess it's how @fitzgen describe it in issue #201.
2016-12-02Unify naming methods into a single method + options builder typeArtem Biryukov
This an implementation of `NameOptions` structure which will hold flags for building a name string. This fixes related to issue #201
2016-11-29Auto merge of #304 - emilio:stylo-fallout, r=fitzgenbors-servo
Bunch of fixes for stylo and libclang 4 r? @fitzgen or @nox
2016-11-29ir: Add a note about duplicated names.Emilio Cobos Álvarez
2016-11-29ir: Don't assume our name is our base name too early when we're in a namespace.Emilio Cobos Álvarez
2016-11-27Auto merge of #305 - aethanyc:restore-links, r=emiliobors-servo
Restore links in README.md These were deleted accidentally in 073b12ff35a8ec6314d655804915f177ce453227.
2016-11-26Restore links in README.mdTing-Yu Lin
These were deleted accidentally in 073b12ff35a8ec6314d655804915f177ce453227.
2016-11-24Some fixes for libclang 4.0.Emilio Cobos Álvarez
2016-11-24Add a new disable-name-namespacing option.Emilio Cobos Álvarez
2016-11-23Auto merge of #285 - tsliang:issue-125, r=emiliobors-servo
clang::Cursor::enum_type should return an Option<Type> Returning an Option<Type> relieves callers from having to check whether clang::Cursor::enum_type returns `CXType_Invalid`. Fixes #125
2016-11-23Use and_then() to properly handle cases when Cursor::enum_type() return NoneTai Sassen-Liang
2016-11-22Circuit-break if Cursor::enum_type returns NoneTai Sassen-Liang
As discussed with @emilio. Part of #125.
2016-11-22Use is_valid instead of checking directly against Type::kindTai Sassen-Liang
Thanks for pointing this out @emilio.
2016-11-22Auto merge of #302 - emilio:whitelist, r=fitzgenbors-servo
ir: Rework how we discover children of modules. r? @fitzgen
2016-11-22ir: Rework how we discover children of modules.Emilio Cobos Álvarez
2016-11-22Auto merge of #301 - emilio:whitelist, r=fitzgenbors-servo
A more coherent story for whitelisting. r? @fitzgen Fixes #300 Fixes #299 Fixes #298
2016-11-22codegen: Don't bother generating an empty module.Emilio Cobos Álvarez
2016-11-22A more coherent story for whitelisting.Emilio Cobos Álvarez
2016-11-22Auto merge of #295 - emilio:dedup-ns, r=noxbors-servo
ir: Deduplicate namespaces.
2016-11-22ir: Deduplicate namespaces.Emilio Cobos Álvarez
2016-11-21Auto merge of #293 - fitzgen:type-referenced-by-whitelisted-function, r=emiliobors-servo
Trace function signature types This extends the `TypeCollector` trait implementation for `Item` to consider items of kind `Function` and to collect the types found in the function's signature. Fixes #291 r? @emilio
2016-11-21Trace function signature typesNick Fitzgerald
This extends the `TypeCollector` trait implementation for `Item` to consider items of kind `Function` and to collect the types found in the function's signature. Fixes #291
2016-11-21Auto merge of #282 - impowski:layout_template_specializations, r=emiliobors-servo
First steps to fix issue #57 This should generate tests for fully specialized templates. TODO: - [x] Tests r? @emilio
2016-11-21Auto merge of #290 - fitzgen:dont-assert-name-target-template-alias, r=emiliobors-servo
Recurse on the inner type when finding a template alias name target The assertion that the template alias's inner type was our name target, and that we didn't need to recurse, is failing when generating SpiderMonkey bindings. I'm not 100% sure when this can happen, but clearly it can, and it is easy to support, so let's support it. r? @emilio
2016-11-21Recurse on the innter type when finding a template alias name targetNick Fitzgerald
The assertion that the template alias's inner type was our name target, and that we didn't need to recurse, is failing when generating SpiderMonkey bindings. I'm not 100% sure when this can happen, but clearly it can, and it is easy to support, so let's support it.
2016-11-21Auto merge of #284 - fitzgen:dont-eval-variadic-templates, r=emiliobors-servo
Do not evaluate variadic template types This is a workaround for an internal clang assertion that gets triggered if we try to evaluate a variadic template type reference. Fixes #283 r? @emilio
2016-11-21Auto merge of #288 - emilio:stylo-bustage, r=fitzgenbors-servo
Better handling of derived types inside namespaces. Not perfect, since for example we can never arrive to the `Type` typedef it seems, but it doesn't generate invalid code, and we handle correctly the non-dependent types. r? @fitzgen
2016-11-21Address review comments.Emilio Cobos Álvarez
2016-11-21ir: Pass the location instead of the declaration for TemplateRef's.Emilio Cobos Álvarez
2016-11-21ir: Explicitly bypass NamespaceRef'sEmilio Cobos Álvarez
2016-11-21ir: Properly recurse inside types.Emilio Cobos Álvarez
2016-11-21Auto merge of #289 - emilio:whitelist-namespace, r=fitzgenbors-servo
codegen: Fix whitelisting inside namespaces. fixes #287 r? @fitzgen
2016-11-21Apply fixes due code review for issue #57Artem Biryukov
2016-11-21Reformat.Emilio Cobos Álvarez
2016-11-21codegen: Fix whitelisting inside namespaces.Emilio Cobos Álvarez
2016-11-20Update error wording for enum_type().expect()Tai Sassen-Liang
2016-11-20clang::Cursor::enum_type should return an Option<Type>Tai Sassen-Liang
Fixes issue #125
2016-11-20Add new expectations for testsArtem Biryukov
2016-11-20Take out template arguments and make unique namesArtem Biryukov
2016-11-20First steps to fix issue #57Artem Biryukov
2016-11-18Do not evaluate variadic template typesNick Fitzgerald
This is a workaround for an internal clang assertion that gets triggered if we try to evaluate a variadic template type reference. Fixes #283
2016-11-18Auto merge of #207 - Natim:130-cursor-args-return-vector, r=emiliobors-servo
clang::Cursor::args should return an Option<Vec<Cursor>> Attempt to fix #130
2016-11-18Auto merge of #281 - fitzgen:namespace-mangle-rust-symbols, r=emiliobors-servo
Include namespaces in mangled symbols When we aren't using `--enable-cxx-namespaces`, we can end up with conflicting struct symbol names that we need to disambiguate. The solution is to mangle the namespaced C++ symbol "foo::bar::Baz" into the Rust "foo_bar_Baz" symbol. This did change the way anonymous types and modules get named a little, but I think our approach is much more sane now than it was before. Fixes #267. r? @emilio
2016-11-18Add a testRémy HUBSCHER
2016-11-18Include namespaces in mangled symbolsNick Fitzgerald
When we aren't using `--enable-cxx-namespaces`, we can end up with conflicting struct symbol names that we need to disambiguate. The solution is to mangle the namespaced C++ symbol "foo::bar::Baz" into the Rust "foo_bar_Baz" symbol.