diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-07 01:10:05 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-11 12:56:55 +0100 |
commit | 73187fa616dd2a8a42fb1c683ebe82df1a4289c3 (patch) | |
tree | 3c3be02bcb532665e7ecb2bb8d77f64448551629 | |
parent | 6bfeae155155a12849033e1c5199ca6e48e8b22c (diff) |
ir: Define a set of items we want to collect types through unconditionally.
-rw-r--r-- | libbindgen/src/ir/ty.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libbindgen/src/ir/ty.rs b/libbindgen/src/ir/ty.rs index df3baf91..e83ef4fd 100644 --- a/libbindgen/src/ir/ty.rs +++ b/libbindgen/src/ir/ty.rs @@ -316,6 +316,20 @@ impl Type { TypeKind::UnresolvedTypeRef(..) => None, } } + + /// There are some types we don't want to stop at when finding an opaque + /// item, so we can arrive to the proper item that needs to be generated. + pub fn should_be_traced_unconditionally(&self) -> bool { + match self.kind { + TypeKind::Function(..) | + TypeKind::Pointer(..) | + TypeKind::Array(..) | + TypeKind::Reference(..) | + TypeKind::TemplateRef(..) | + TypeKind::ResolvedTypeRef(..) => true, + _ => false, + } + } } impl CanDeriveDebug for Type { |