diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-01-20 14:21:54 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-01-23 09:52:53 -0800 |
commit | f347ce2ddc7f18a05205b8243ac5d0a61b69f9f1 (patch) | |
tree | 646c71ee75d398c4c644c5d35b9808474d92cb22 | |
parent | 5229dc2f1dba07673138b2bafd40f3ea022fa0ba (diff) |
Trace all variants of TypeKind
-rw-r--r-- | src/ir/ty.rs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs index c1ed5b64..1e87beb4 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -914,13 +914,24 @@ impl TypeCollector for Type { TypeKind::Function(ref sig) => { sig.collect_types(context, types, item) } - TypeKind::Named(_) => {} - // FIXME: Pending types! - ref other @ _ => { - debug!("<Type as TypeCollector>::collect_types: Ignoring: \ - {:?}", - other); + TypeKind::Enum(ref en) => { + if let Some(repr) = en.repr() { + types.insert(repr); + } + } + TypeKind::UnresolvedTypeRef(_, _, Some(id)) => { + types.insert(id); } + + // None of these variants have edges to other items and types. + TypeKind::UnresolvedTypeRef(_, _, None) | + TypeKind::Named(_) | + TypeKind::Void | + TypeKind::NullPtr | + TypeKind::Int(_) | + TypeKind::Float(_) | + TypeKind::Complex(_) | + TypeKind::BlockPointer => {} } } } |