diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-21 14:28:35 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-21 14:37:28 -0800 |
commit | bd29a7a86ec9b7a2666fe290da940e319e71b008 (patch) | |
tree | cedf884b6cdce3dab6d87a4f5db21678e70c2a65 /libbindgen/src | |
parent | 77868f4379dc40b91dfd3674c8091c14dcf69ecd (diff) |
Trace function signature types
This extends the `TypeCollector` trait implementation for `Item` to
consider items of kind `Function` and to collect the types found in the
function's signature.
Fixes #291
Diffstat (limited to 'libbindgen/src')
-rw-r--r-- | libbindgen/src/ir/item.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libbindgen/src/ir/item.rs b/libbindgen/src/ir/item.rs index d96936ad..b857acf9 100644 --- a/libbindgen/src/ir/item.rs +++ b/libbindgen/src/ir/item.rs @@ -142,6 +142,11 @@ impl TypeCollector for Item { ty.collect_types(ctx, types, self); } } + ItemKind::Function(ref fun) => { + if !self.is_opaque(ctx) { + types.insert(fun.signature()); + } + } _ => {} // FIXME. } } |