diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2023-10-26 17:42:02 -0400 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2023-10-26 17:42:02 -0400 |
| commit | c797cccda61e1116fa4a2e8feb0fb43432add599 (patch) | |
| tree | 0c135dadf0e67d118d77ddb06e449d0014f6f22a /compiler/rustc_codegen_gcc/src/declare.rs | |
| parent | 8396efecf7d30ca9f7edcf76aba2ea388300f6ab (diff) | |
| parent | e4fe941b11a55c5005630696e9b6d81c65f7bd04 (diff) | |
| download | rust-c797cccda61e1116fa4a2e8feb0fb43432add599.tar.gz rust-c797cccda61e1116fa4a2e8feb0fb43432add599.zip | |
Merge commit 'e4fe941b11a55c5005630696e9b6d81c65f7bd04' into subtree-update_cg_gcc_2023-10-25
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/declare.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/declare.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_gcc/src/declare.rs b/compiler/rustc_codegen_gcc/src/declare.rs index e673d0af4c7..247454fa58e 100644 --- a/compiler/rustc_codegen_gcc/src/declare.rs +++ b/compiler/rustc_codegen_gcc/src/declare.rs @@ -6,7 +6,7 @@ use rustc_middle::ty::Ty; use rustc_span::Symbol; use rustc_target::abi::call::FnAbi; -use crate::abi::FnAbiGccExt; +use crate::abi::{FnAbiGcc, FnAbiGccExt}; use crate::context::CodegenCx; use crate::intrinsic::llvm; @@ -80,9 +80,20 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> { } pub fn declare_fn(&self, name: &str, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> Function<'gcc> { - let (return_type, params, variadic, on_stack_param_indices) = fn_abi.gcc_type(self); - let func = declare_raw_fn(self, name, () /*fn_abi.llvm_cconv()*/, return_type, ¶ms, variadic); + let FnAbiGcc { + return_type, + arguments_type, + is_c_variadic, + on_stack_param_indices, + #[cfg(feature="master")] + fn_attributes, + } = fn_abi.gcc_type(self); + let func = declare_raw_fn(self, name, () /*fn_abi.llvm_cconv()*/, return_type, &arguments_type, is_c_variadic); self.on_stack_function_params.borrow_mut().insert(func, on_stack_param_indices); + #[cfg(feature="master")] + for fn_attr in fn_attributes { + func.add_attribute(fn_attr); + } func } |
