Skip to content

Commit 2f1d614

Browse files
committed
todo
1 parent 358171b commit 2f1d614

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

  • compiler/rustc_codegen_ssa/src/mir

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,39 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
918918
generic_args,
919919
fn_span,
920920
);
921+
if Some(instance.def_id()) == bx.tcx().lang_items().preload_fn() {
922+
let target = target.unwrap();
923+
924+
// 1. Codegen MIR args into OperandRefs.
925+
// 2. Emit __tgt_target_data_begin_mapper.
926+
// 3. Store Preload { cpu_ptr: arg_ptr, _marker: PhantomData } into destination.
927+
// 4. Branch to target.
928+
return self.codegen_offload_preload_call(
929+
helper,
930+
bx,
931+
args,
932+
destination,
933+
target,
934+
fn_span,
935+
mergeable_succ,
936+
/* mutable */ false,
937+
);
938+
}
939+
940+
if Some(instance.def_id()) == bx.tcx().lang_items().preload_mut_fn() {
941+
let target = target.unwrap();
942+
943+
return self.codegen_offload_preload_call(
944+
helper,
945+
bx,
946+
args,
947+
destination,
948+
target,
949+
fn_span,
950+
mergeable_succ,
951+
/* mutable */ true,
952+
);
953+
}
921954

922955
match instance.def {
923956
// We don't need AsyncDropGlueCtorShim here because it is not `noop func`,

0 commit comments

Comments
 (0)