@@ -7,7 +7,7 @@ use super::item::Item;
77use super :: traversal:: { EdgeKind , Trace , Tracer } ;
88use super :: ty:: TypeKind ;
99use crate :: callbacks:: { ItemInfo , ItemKind } ;
10- use crate :: clang:: { self , Attribute } ;
10+ use crate :: clang:: { self , ABIKind , Attribute } ;
1111use crate :: parse:: { ClangSubItemParser , ParseError , ParseResult } ;
1212use clang_sys:: { self , CXCallingConv } ;
1313
@@ -324,11 +324,12 @@ pub(crate) fn cursor_mangling(
324324 return None ;
325325 }
326326
327+ let is_itanium_abi = ctx. abi_kind ( ) == ABIKind :: GenericItanium ;
327328 let is_destructor = cursor. kind ( ) == clang_sys:: CXCursor_Destructor ;
328329 if let Ok ( mut manglings) = cursor. cxx_manglings ( ) {
329330 while let Some ( m) = manglings. pop ( ) {
330331 // Only generate the destructor group 1, see below.
331- if is_destructor && !m. ends_with ( "D1Ev" ) {
332+ if is_itanium_abi && is_destructor && !m. ends_with ( "D1Ev" ) {
332333 continue ;
333334 }
334335
@@ -341,7 +342,7 @@ pub(crate) fn cursor_mangling(
341342 return None ;
342343 }
343344
344- if is_destructor {
345+ if is_itanium_abi && is_destructor {
345346 // With old (3.8-) libclang versions, and the Itanium ABI, clang returns
346347 // the "destructor group 0" symbol, which means that it'll try to free
347348 // memory, which definitely isn't what we want.
0 commit comments