|
1 | 1 | //! Common traits and types related to parsing our IR from Clang cursors.
|
2 | 2 |
|
3 | 3 | use crate::clang;
|
4 |
| -use crate::ir::context::{BindgenContext, ItemId, TypeId}; |
5 |
| -use crate::ir::ty::TypeKind; |
| 4 | +use crate::ir::context::{BindgenContext, ItemId}; |
6 | 5 |
|
7 | 6 | /// Not so much an error in the traditional sense, but a control flow message
|
8 | 7 | /// when walking over Clang's AST with a cursor.
|
@@ -39,64 +38,3 @@ pub trait ClangSubItemParser: Sized {
|
39 | 38 | context: &mut BindgenContext,
|
40 | 39 | ) -> Result<ParseResult<Self>, ParseError>;
|
41 | 40 | }
|
42 |
| - |
43 |
| -/// An intermediate representation item that can be parsed from a Clang cursor. |
44 |
| -pub trait ClangItemParser: Sized { |
45 |
| - /// Parse this item from the given Clang cursor. |
46 |
| - fn parse( |
47 |
| - cursor: clang::Cursor, |
48 |
| - parent: Option<ItemId>, |
49 |
| - context: &mut BindgenContext, |
50 |
| - ) -> Result<ItemId, ParseError>; |
51 |
| - |
52 |
| - /// Parse this item from the given Clang type. |
53 |
| - fn from_ty( |
54 |
| - ty: &clang::Type, |
55 |
| - location: clang::Cursor, |
56 |
| - parent: Option<ItemId>, |
57 |
| - ctx: &mut BindgenContext, |
58 |
| - ) -> Result<TypeId, ParseError>; |
59 |
| - |
60 |
| - /// Identical to `from_ty`, but use the given `id` as the `ItemId` for the |
61 |
| - /// newly parsed item. |
62 |
| - fn from_ty_with_id( |
63 |
| - id: ItemId, |
64 |
| - ty: &clang::Type, |
65 |
| - location: clang::Cursor, |
66 |
| - parent: Option<ItemId>, |
67 |
| - ctx: &mut BindgenContext, |
68 |
| - ) -> Result<TypeId, ParseError>; |
69 |
| - |
70 |
| - /// Parse this item from the given Clang type, or if we haven't resolved all |
71 |
| - /// the other items this one depends on, an unresolved reference. |
72 |
| - fn from_ty_or_ref( |
73 |
| - ty: clang::Type, |
74 |
| - location: clang::Cursor, |
75 |
| - parent_id: Option<ItemId>, |
76 |
| - context: &mut BindgenContext, |
77 |
| - ) -> TypeId; |
78 |
| - |
79 |
| - /// Identical to `from_ty_or_ref`, but use the given `potential_id` as the |
80 |
| - /// `ItemId` for the newly parsed item. |
81 |
| - fn from_ty_or_ref_with_id( |
82 |
| - potential_id: ItemId, |
83 |
| - ty: clang::Type, |
84 |
| - location: clang::Cursor, |
85 |
| - parent_id: Option<ItemId>, |
86 |
| - context: &mut BindgenContext, |
87 |
| - ) -> TypeId; |
88 |
| - |
89 |
| - /// Create a named template type. |
90 |
| - fn type_param( |
91 |
| - with_id: Option<ItemId>, |
92 |
| - location: clang::Cursor, |
93 |
| - ctx: &mut BindgenContext, |
94 |
| - ) -> Option<TypeId>; |
95 |
| - |
96 |
| - /// Create a builtin type. |
97 |
| - fn builtin_type( |
98 |
| - kind: TypeKind, |
99 |
| - is_const: bool, |
100 |
| - context: &mut BindgenContext, |
101 |
| - ) -> TypeId; |
102 |
| -} |
0 commit comments