summaryrefslogtreecommitdiff
path: root/src/ir/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r--src/ir/function.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs
index 0cf23f43..fc2a7110 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -1,8 +1,9 @@
//! Intermediate representation for C/C++ functions and methods.
+use super::context::BindgenContext;
use super::item::{Item, ItemId};
use super::ty::TypeKind;
-use super::context::BindgenContext;
+use super::type_collector::{ItemSet, TypeCollector};
use syntax::abi;
use clang;
use clangll::Enum_CXCallingConv;
@@ -246,3 +247,18 @@ impl ClangSubItemParser for Function {
Ok(ParseResult::New(function, Some(cursor)))
}
}
+
+impl TypeCollector for FunctionSig {
+ type Extra = Item;
+
+ fn collect_types(&self,
+ context: &BindgenContext,
+ types: &mut ItemSet,
+ _item: &Item) {
+ self.return_type().collect_types(context, types, &());
+
+ for &(_, ty) in self.argument_types() {
+ ty.collect_types(context, types, &());
+ }
+ }
+}