diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-06 10:24:30 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-06 10:25:47 +0100 |
commit | bf1c41dc627f26a782c948868a5f270235d58725 (patch) | |
tree | 55c0a9580de80fda3a66bbd929035baa76eb466a /libbindgen/src/codegen/mod.rs | |
parent | 40254959b2e009de30836faf4edf7fecae34cc7f (diff) |
ir: Change our representation of base types so they also have a base kind.
This still doesn't change behavior, but it's nice to split it for easier review.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
Diffstat (limited to 'libbindgen/src/codegen/mod.rs')
-rw-r--r-- | libbindgen/src/codegen/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libbindgen/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs index 24b862be..c4dc9644 100644 --- a/libbindgen/src/codegen/mod.rs +++ b/libbindgen/src/codegen/mod.rs @@ -4,7 +4,7 @@ mod helpers; use aster; use ir::annotations::FieldAccessorKind; -use ir::comp::{CompInfo, CompKind, Field, Method, MethodKind}; +use ir::comp::{Base, CompInfo, CompKind, Field, Method, MethodKind}; use ir::context::{BindgenContext, ItemId}; use ir::derive::{CanDeriveCopy, CanDeriveDebug}; use ir::enum_ty::{Enum, EnumVariant, EnumVariantValue}; @@ -556,13 +556,13 @@ struct Vtable<'a> { #[allow(dead_code)] methods: &'a [Method], #[allow(dead_code)] - base_classes: &'a [ItemId], + base_classes: &'a [Base], } impl<'a> Vtable<'a> { fn new(item_id: ItemId, methods: &'a [Method], - base_classes: &'a [ItemId]) + base_classes: &'a [Base]) -> Self { Vtable { item_id: item_id, @@ -835,7 +835,7 @@ impl CodeGenerator for CompInfo { } for (i, base) in self.base_members().iter().enumerate() { - let base_ty = ctx.resolve_type(*base); + let base_ty = ctx.resolve_type(base.ty); // NB: We won't include unsized types in our base chain because they // would contribute to our size given the dummy field we insert for // unsized types. @@ -854,7 +854,7 @@ impl CodeGenerator for CompInfo { } } - let inner = base.to_rust_ty(ctx); + let inner = base.ty.to_rust_ty(ctx); let field_name = if i == 0 { "_base".into() } else { |