File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
compiler/rustc_codegen_ssa/src/traits Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -555,12 +555,19 @@ pub trait BuilderMethods<'a, 'tcx>:
555
555
/// Called for `StorageDead`
556
556
fn lifetime_end ( & mut self , ptr : Self :: Value , size : Size ) ;
557
557
558
+ /// "Finally codegen the call"
559
+ ///
560
+ /// The typical case that an argument is None is during the codegen of intrinsics,
561
+ /// as they are "fake functions" that have no meaningful ABI.
562
+ ///
563
+ /// Must return the value the function will return so it can be written to the destination,
564
+ /// assuming the function does not explicitly pass the destination as an pointer in args.
558
565
fn call (
559
566
& mut self ,
560
567
llty : Self :: Type ,
561
568
fn_attrs : Option < & CodegenFnAttrs > ,
562
569
fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > ,
563
- llfn : Self :: Value ,
570
+ fn_val : Self :: Value ,
564
571
args : & [ Self :: Value ] ,
565
572
funclet : Option < & Self :: Funclet > ,
566
573
instance : Option < Instance < ' tcx > > ,
Original file line number Diff line number Diff line change @@ -6,16 +6,22 @@ use crate::mir::operand::OperandRef;
6
6
use crate :: mir:: place:: PlaceRef ;
7
7
8
8
pub trait IntrinsicCallBuilderMethods < ' tcx > : BackendTypes {
9
+ /// Higher-level interface to emitting calls to intrinsics
10
+ ///
9
11
/// Remember to add all intrinsics here, in `compiler/rustc_hir_analysis/src/check/mod.rs`,
10
12
/// and in `library/core/src/intrinsics.rs`; if you need access to any LLVM intrinsics,
11
13
/// add them to `compiler/rustc_codegen_llvm/src/context.rs`.
12
14
/// Returns `Err` if another instance should be called instead. This is used to invoke
13
15
/// intrinsic default bodies in case an intrinsic is not implemented by the backend.
16
+ ///
17
+ /// NOTE: allowed to call [`BuilderMethods::call`]
18
+ ///
19
+ /// [`BuilderMethods::call`]: super::builder::BuilderMethods::call
14
20
fn codegen_intrinsic_call (
15
21
& mut self ,
16
22
instance : ty:: Instance < ' tcx > ,
17
23
args : & [ OperandRef < ' tcx , Self :: Value > ] ,
18
- result : PlaceRef < ' tcx , Self :: Value > ,
24
+ result_dest : PlaceRef < ' tcx , Self :: Value > ,
19
25
span : Span ,
20
26
) -> Result < ( ) , ty:: Instance < ' tcx > > ;
21
27
You can’t perform that action at this time.
0 commit comments