Skip to content

Commit 4e244c7

Browse files
authored
Rollup merge of #150768 - bjorn3:llvm_intrinsic_no_fn_abi, r=wesleywiser
Don't compute FnAbi for LLVM intrinsics in backends ~~This removes support for `extern "unadjusted"` for anything other than LLVM intrinsics. It only makes sense in the context of calling LLVM intrinsics anyway as it exposes the way the LLVM backend internally represents types. Perhaps it should be renamed to `extern "llvm-intrinsic"`?~~ Follow up to rust-lang/rust#148533
2 parents e4e725a + e90414f commit 4e244c7

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/intrinsic/mod.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ use rustc_codegen_ssa::traits::{
2222
ArgAbiBuilderMethods, BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods,
2323
IntrinsicCallBuilderMethods, LayoutTypeCodegenMethods,
2424
};
25+
use rustc_data_structures::fx::FxHashSet;
2526
use rustc_middle::bug;
26-
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
27+
#[cfg(feature = "master")]
28+
use rustc_middle::ty::layout::FnAbiOf;
29+
use rustc_middle::ty::layout::LayoutOf;
2730
use rustc_middle::ty::{self, Instance, Ty};
2831
use rustc_span::{Span, Symbol, sym};
2932
use rustc_target::callconv::{ArgAbi, PassMode};
3033

31-
use crate::abi::{FnAbiGccExt, GccType};
34+
#[cfg(feature = "master")]
35+
use crate::abi::FnAbiGccExt;
36+
use crate::abi::GccType;
3237
use crate::builder::Builder;
3338
use crate::common::{SignType, TypeReflection};
3439
use crate::context::CodegenCx;
@@ -617,8 +622,6 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
617622
*func
618623
} else {
619624
self.linkage.set(FunctionType::Extern);
620-
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
621-
let fn_ty = fn_abi.gcc_type(self);
622625

623626
let func = match sym {
624627
"llvm.fma.f16" => {
@@ -631,13 +634,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
631634

632635
self.intrinsics.borrow_mut().insert(sym.to_string(), func);
633636

634-
self.on_stack_function_params
635-
.borrow_mut()
636-
.insert(func, fn_ty.on_stack_param_indices);
637-
#[cfg(feature = "master")]
638-
for fn_attr in fn_ty.fn_attributes {
639-
func.add_attribute(fn_attr);
640-
}
637+
self.on_stack_function_params.borrow_mut().insert(func, FxHashSet::default());
641638

642639
crate::attributes::from_fn_attrs(self, func, instance);
643640

0 commit comments

Comments
 (0)