Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "bindgen"
readme = "README.md"
repository = "https://github.com/servo/rust-bindgen"
documentation = "https://docs.rs/bindgen"
version = "0.21.1"
version = "0.21.2"
build = "build.rs"

exclude = ["tests/headers", "tests/expectations"]
Expand Down
25 changes: 14 additions & 11 deletions src/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1366,27 +1366,30 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {

if let Some(refd) = c.referenced() {
if refd != *c {
println!();
println!("");
print_cursor(depth,
String::from(prefix) + "referenced.",
&refd);
print_cursor(depth, String::from(prefix) + "referenced.", &refd);
}
}

let canonical = c.canonical();
if canonical != *c {
println!();
println!("");
print_cursor(depth,
String::from(prefix) + "canonical.",
&canonical);
print_cursor(depth, String::from(prefix) + "canonical.", &canonical);
}

if let Some(specialized) = c.specialized() {
if specialized != *c {
println!();
println!("");
print_cursor(depth,
String::from(prefix) + "specialized.",
&specialized);
print_cursor(depth, String::from(prefix) + "specialized.", &specialized);
}
}
}
Expand Down Expand Up @@ -1419,56 +1422,56 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {

let canonical = ty.canonical_type();
if canonical != *ty {
println!();
println!("");
print_type(depth, String::from(prefix) + "canonical.", &canonical);
}

if let Some(pointee) = ty.pointee_type() {
if pointee != *ty {
println!();
println!("");
print_type(depth, String::from(prefix) + "pointee.", &pointee);
}
}

if let Some(elem) = ty.elem_type() {
if elem != *ty {
println!();
println!("");
print_type(depth, String::from(prefix) + "elements.", &elem);
}
}

if let Some(ret) = ty.ret_type() {
if ret != *ty {
println!();
println!("");
print_type(depth, String::from(prefix) + "return.", &ret);
}
}

let named = ty.named();
if named != *ty && named.is_valid() {
println!();
println!("");
print_type(depth, String::from(prefix) + "named.", &named);
}
}

print_indent(depth, "(");
print_cursor(depth, "", c);

println!();
println!("");
let ty = c.cur_type();
print_type(depth, "type.", &ty);

let declaration = ty.declaration();
if declaration != *c && declaration.kind() != CXCursor_NoDeclFound {
println!();
println!("");
print_cursor(depth, "type.declaration.", &declaration);
}

// Recurse.
let mut found_children = false;
c.visit(|s| {
if !found_children {
println!();
println!("");
found_children = true;
}
ast_dump(&s, depth + 1)
Expand Down