diff options
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r-- | src/ir/function.rs | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs index 3a9f337c..b637f9f1 100644 --- a/src/ir/function.rs +++ b/src/ir/function.rs @@ -206,23 +206,6 @@ fn get_abi(cc: CXCallingConv) -> Abi { } } -fn mangling_hack_if_needed(ctx: &BindgenContext, symbol: &mut String) { - if ctx.needs_mangling_hack() { - match symbol.chars().next().unwrap() { - // Stripping leading underscore for all names on Darwin and - // C linkage functions on Win32. - '_' => { - symbol.remove(0); - } - // Stop Rust from prepending underscore for variables on Win32. - '?' => { - symbol.insert(0, '\x01'); - } - _ => {} - } - } -} - /// Get the mangled name for the cursor's referent. pub fn cursor_mangling( ctx: &BindgenContext, @@ -241,8 +224,7 @@ pub fn cursor_mangling( } if let Ok(mut manglings) = cursor.cxx_manglings() { - if let Some(mut m) = manglings.pop() { - mangling_hack_if_needed(ctx, &mut m); + if let Some(m) = manglings.pop() { return Some(m); } } @@ -252,8 +234,6 @@ pub fn cursor_mangling( return None; } - mangling_hack_if_needed(ctx, &mut mangling); - if cursor.kind() == clang_sys::CXCursor_Destructor { // With old (3.8-) libclang versions, and the Itanium ABI, clang returns // the "destructor group 0" symbol, which means that it'll try to free |