Skip to content

Commit 1bafbfb

Browse files
emilioAatif Syed
authored and
Aatif Syed
committed
codegen: Simplify abi support condition.
1 parent 8cface0 commit 1bafbfb

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/codegen/mod.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use self::struct_layout::StructLayoutTracker;
1717

1818
use super::BindgenOptions;
1919

20-
use crate::features::RustFeatures;
2120
use crate::ir::analysis::{HasVtable, Sizedness};
2221
use crate::ir::annotations::FieldAccessorKind;
2322
use crate::ir::comment;
@@ -2415,22 +2414,14 @@ impl MethodCodegen for Method {
24152414
_ => panic!("How in the world?"),
24162415
};
24172416

2418-
match (signature.abi(), ctx.options().rust_features()) {
2419-
(
2420-
Abi::ThisCall,
2421-
RustFeatures {
2422-
thiscall_abi: false,
2423-
..
2424-
},
2425-
) |
2426-
(
2427-
Abi::Vectorcall,
2428-
RustFeatures {
2429-
vectorcall_abi: false,
2430-
..
2431-
},
2432-
) => return,
2433-
_ => {}
2417+
let supported_abi = match signature.abi() {
2418+
Abi::ThisCall => ctx.options().rust_features().thiscall_abi,
2419+
Abi::Vectorcall => ctx.options().rust_features().vectorcall_abi,
2420+
_ => true,
2421+
};
2422+
2423+
if !supported_abi {
2424+
return;
24342425
}
24352426

24362427
// Do not generate variadic methods, since rust does not allow

0 commit comments

Comments
 (0)