diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-05 09:38:01 -0800 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-07 16:07:38 -1000 |
commit | f684e77b950c00454909a54df7a26335b68e05ca (patch) | |
tree | 34e10c238673d3215500ba48f7f8b170670505d6 /libbindgen/src/codegen/mod.rs | |
parent | 9ac59f8ad0171dc93cced2a2d69b49fcf13f814a (diff) |
ir: Saner whitelisting/blacklisting.
Diffstat (limited to 'libbindgen/src/codegen/mod.rs')
-rw-r--r-- | libbindgen/src/codegen/mod.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libbindgen/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs index d2e2b96c..95a6f611 100644 --- a/libbindgen/src/codegen/mod.rs +++ b/libbindgen/src/codegen/mod.rs @@ -467,12 +467,9 @@ impl CodeGenerator for Type { TypeKind::Comp(ref ci) => { ci.codegen(ctx, result, whitelisted_items, item) } - // NB: The inner Alias will be generated and pick the correct + // NB: The code below will pick the correct // applicable_template_args. - TypeKind::TemplateAlias(inner, _) => { - ctx.resolve_item(inner) - .codegen(ctx, result, whitelisted_items, &()) - }, + TypeKind::TemplateAlias(ref spelling, inner, _) | TypeKind::Alias(ref spelling, inner) => { let inner_item = ctx.resolve_item(inner); let name = item.canonical_name(ctx); @@ -1777,10 +1774,9 @@ impl ToRustTy for Type { aster::ty::TyBuilder::new().array(len).build(inner) } TypeKind::Enum(..) => { - let path = item.canonical_path(ctx); + let path = item.namespace_aware_canonical_path(ctx); aster::AstBuilder::new().ty().path().ids(path).build() } - TypeKind::TemplateAlias(inner, ref template_args) | TypeKind::TemplateRef(inner, ref template_args) => { // PS: Sorry for the duplication here. let mut inner_ty = inner.to_rust_ty(ctx).unwrap(); @@ -1803,6 +1799,7 @@ impl ToRustTy for Type { P(inner_ty) } TypeKind::ResolvedTypeRef(inner) => inner.to_rust_ty(ctx), + TypeKind::TemplateAlias(ref spelling, inner, _) | TypeKind::Alias(ref spelling, inner) => { if item.is_opaque(ctx) { // Pray if there's no available layout. @@ -2141,7 +2138,7 @@ mod utils { ctx: &BindgenContext, only_named: bool) -> P<ast::Ty> { - let path = item.canonical_path(ctx); + let path = item.namespace_aware_canonical_path(ctx); let builder = aster::AstBuilder::new().ty().path(); let template_args = if only_named { |