diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-03-15 03:47:53 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-03-15 03:48:15 +0100 |
commit | 91b5371df62447fb91549b758ad3025dc83f295b (patch) | |
tree | 1612f4c993b09b996906c96b594fd784895726a4 | |
parent | 1b66dcf87692e455dc5e1603ca05d3f41b3f771b (diff) |
codegen: Simplify abi support condition.
-rw-r--r-- | src/codegen/mod.rs | 25 |
1 files 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 |