Skip to content

Commit 024b79c

Browse files
committed
Trace all variants of TypeKind
1 parent bff5838 commit 024b79c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

libbindgen/src/ir/ty.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -914,13 +914,24 @@ impl TypeCollector for Type {
914914
TypeKind::Function(ref sig) => {
915915
sig.collect_types(context, types, item)
916916
}
917-
TypeKind::Named(_) => {}
918-
// FIXME: Pending types!
919-
ref other @ _ => {
920-
debug!("<Type as TypeCollector>::collect_types: Ignoring: \
921-
{:?}",
922-
other);
917+
TypeKind::Enum(ref en) => {
918+
if let Some(repr) = en.repr() {
919+
types.insert(repr);
920+
}
921+
}
922+
TypeKind::UnresolvedTypeRef(_, _, Some(id)) => {
923+
types.insert(id);
923924
}
925+
926+
// None of these variants have edges to other items and types.
927+
TypeKind::UnresolvedTypeRef(_, _, None) |
928+
TypeKind::Named(_) |
929+
TypeKind::Void |
930+
TypeKind::NullPtr |
931+
TypeKind::Int(_) |
932+
TypeKind::Float(_) |
933+
TypeKind::Complex(_) |
934+
TypeKind::BlockPointer => {}
924935
}
925936
}
926937
}

0 commit comments

Comments
 (0)