diff options
Diffstat (limited to 'src/ir/enum_ty.rs')
-rw-r--r-- | src/ir/enum_ty.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/ir/enum_ty.rs b/src/ir/enum_ty.rs index 0a85577e..3470e033 100644 --- a/src/ir/enum_ty.rs +++ b/src/ir/enum_ty.rs @@ -5,8 +5,6 @@ use super::item::Item; use super::ty::TypeKind; use clang; use ir::annotations::Annotations; -use ir::int::IntKind; -use ir::layout::Layout; use parse::{ClangItemParser, ParseError}; /// An enum representing custom handling that can be given to a variant. @@ -51,19 +49,6 @@ impl Enum { &self.variants } - /// Compute the layout of this type. - pub fn calc_layout(&self, ctx: &BindgenContext) -> Option<Layout> { - self.repr - .map(|repr| ctx.resolve_type(repr)) - .and_then(|repr| match *repr.canonical_type(ctx).kind() { - TypeKind::Int(int_kind) => Some(int_kind), - _ => None, - }) - .unwrap_or(IntKind::Int) - .known_size() - .map(|size| Layout::new(size, size)) - } - /// Construct an enumeration from the given Clang type. pub fn from_ty(ty: &clang::Type, ctx: &mut BindgenContext) @@ -114,7 +99,7 @@ impl Enum { Annotations::new(&cursor) .and_then(|anno| if anno.hide() { Some(EnumVariantCustomBehavior::Hide) - } else if + } else if anno.constify_enum_variant() { Some(EnumVariantCustomBehavior::Constify) } else { |