summaryrefslogtreecommitdiff
path: root/src/ir/function.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-04-24 08:47:51 -0500
committerGitHub <noreply@github.com>2017-04-24 08:47:51 -0500
commit2af4f826579dc9e4f65e8934e77b25a77c711716 (patch)
tree6ddb9d26bd9fe526136c7074660c6d6d4e20c837 /src/ir/function.rs
parentce8feb3262a26a24837a89a4702b606ebe705c8a (diff)
parent20d5140a1ac950a8499e357a51604c5032321cfd (diff)
Auto merge of #657 - emilio:cxx-mangling, r=fitzgen
ir: Try to get C++ manglings with the appropriate API first. As pointed out in #653, clang 3.8 asserts when trying to mangle a C++ constructor or a destructor. The following patch tries to use the `clang_Cursor_getCXXManglings` function first. This assumes that the last mangling we're interested in is the proper one, which seems to be true looking at LLVM, and on trunk on my machine. Fixes #653
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r--src/ir/function.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs
index 0809b3c2..23503b05 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -126,6 +126,12 @@ pub fn cursor_mangling(ctx: &BindgenContext,
return None;
}
+ if let Ok(mut manglings) = cursor.cxx_manglings() {
+ if let Some(m) = manglings.pop() {
+ return Some(m);
+ }
+ }
+
let mut mangling = cursor.mangling();
if mangling.is_empty() {
return None;