diff options
Diffstat (limited to 'src/clang.rs')
-rw-r--r-- | src/clang.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/clang.rs b/src/clang.rs index 613e08e8..1a45eefa 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -875,7 +875,11 @@ impl Type { pub fn named(&self) -> Type { unsafe { Type { - x: clang_Type_getNamedType(self.x), + x: if clang_Type_getNamedType::is_loaded() { + clang_Type_getNamedType(self.x) + } else { + self.x + }, } } } @@ -1498,6 +1502,13 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult { &specialized); } } + + if let Some(parent) = c.fallible_semantic_parent() { + println!(""); + print_cursor(depth, + String::from(prefix) + "semantic-parent.", + &parent); + } } fn print_type<S: AsRef<str>>(depth: isize, prefix: S, ty: &Type) { |