diff options
-rw-r--r-- | src/clang.rs | 12 | ||||
-rw-r--r-- | src/clangll.rs | 6 | ||||
-rw-r--r-- | src/parser.rs | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/clang.rs b/src/clang.rs index 6233adea..0143c4db 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -455,6 +455,13 @@ impl Type { clang_getFunctionTypeCallingConv(self.x) } } + + #[cfg(not(feature="llvm_stable"))] + pub fn named(&self) -> Type { + unsafe { + Type { x: clang_Type_getNamedType(self.x) } + } + } } // SourceLocation @@ -955,6 +962,11 @@ pub fn type_to_str(x: Enum_CXTypeKind) -> &'static str { CXType_IncompleteArray => "IncompleteArray", CXType_VariableArray => "VariableArray", CXType_DependentSizedArray => "DependentSizedArray", + CXType_MemberPointer => "MemberPointer", + #[cfg(not(feature="llvm_stable"))] + CXType_Auto => "Auto", + #[cfg(not(feature="llvm_stable"))] + CXType_Elaborated => "Elaborated", _ => "?" } } diff --git a/src/clangll.rs b/src/clangll.rs index dd836694..b94356bc 100644 --- a/src/clangll.rs +++ b/src/clangll.rs @@ -408,6 +408,10 @@ pub const CXType_IncompleteArray: c_uint = 114; pub const CXType_VariableArray: c_uint = 115; pub const CXType_DependentSizedArray: c_uint = 116; pub const CXType_MemberPointer: c_uint = 117; +#[cfg(not(feature="llvm_stable"))] +pub const CXType_Auto: c_uint = 118; +#[cfg(not(feature="llvm_stable"))] +pub const CXType_Elaborated: c_uint = 119; pub type Enum_CXCallingConv = c_uint; pub const CXCallingConv_Default: c_uint = 0; pub const CXCallingConv_C: c_uint = 1; @@ -1108,6 +1112,8 @@ extern "C" { pub fn clang_Type_getNumTemplateArguments(T: CXType) -> c_int; pub fn clang_Type_getTemplateArgumentAsType(T: CXType, i: c_int) -> CXType; + #[cfg(not(feature="llvm_stable"))] + pub fn clang_Type_getNamedType(CT: CXType) -> CXType; pub fn clang_Cursor_isBitField(C: CXCursor) -> c_uint; #[cfg(not(feature="llvm_stable"))] pub fn clang_Cursor_isFunctionInlined(C: CXCursor) -> c_uint; diff --git a/src/parser.rs b/src/parser.rs index 18a87a58..1acf1c60 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -490,6 +490,8 @@ fn conv_ty_resolving_typedefs(ctx: &mut ClangParserCtx, CXType_Unexposed | CXType_Enum => conv_decl_ty_resolving_typedefs(ctx, ty, cursor, resolve_typedefs), CXType_ConstantArray => TArray(Box::new(conv_ty_resolving_typedefs(ctx, &ty.elem_type(), cursor, resolve_typedefs)), ty.array_size(), layout), + #[cfg(not(feature="llvm_stable"))] + CXType_Elaborated => conv_ty_resolving_typedefs(ctx, &ty.named(), cursor, resolve_typedefs), _ => { let fail = ctx.options.fail_on_unknown_type; log_err_warn(ctx, |