From 91b5371df62447fb91549b758ad3025dc83f295b Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Tue, 15 Mar 2022 03:47:53 +0100 Subject: codegen: Simplify abi support condition. --- src/codegen/mod.rs | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 1b54597f..b988a516 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -17,7 +17,6 @@ use self::struct_layout::StructLayoutTracker; use super::BindgenOptions; -use crate::features::RustFeatures; use crate::ir::analysis::{HasVtable, Sizedness}; use crate::ir::annotations::FieldAccessorKind; use crate::ir::comment; @@ -2415,22 +2414,14 @@ impl MethodCodegen for Method { _ => panic!("How in the world?"), }; - match (signature.abi(), ctx.options().rust_features()) { - ( - Abi::ThisCall, - RustFeatures { - thiscall_abi: false, - .. - }, - ) | - ( - Abi::Vectorcall, - RustFeatures { - vectorcall_abi: false, - .. - }, - ) => return, - _ => {} + let supported_abi = match signature.abi() { + Abi::ThisCall => ctx.options().rust_features().thiscall_abi, + Abi::Vectorcall => ctx.options().rust_features().vectorcall_abi, + _ => true, + }; + + if !supported_abi { + return; } // Do not generate variadic methods, since rust does not allow -- cgit v1.2.3