MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / store_fn_arg

Method store_fn_arg

crates/rustc_codegen_spirv/src/builder/mod.rs:315–340  ·  view source on GitHub ↗
(
        &mut self,
        arg_abi: &ArgAbi<'tcx, Ty<'tcx>>,
        idx: &mut usize,
        dst: PlaceRef<'tcx, Self::Value>,
    )

Source from the content-addressed store, hash-verified

313
314impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
315 fn store_fn_arg(
316 &mut self,
317 arg_abi: &ArgAbi<'tcx, Ty<'tcx>>,
318 idx: &mut usize,
319 dst: PlaceRef<'tcx, Self::Value>,
320 ) {
321 fn next(bx: &mut Builder<'_, '_>, idx: &mut usize) -> SpirvValue {
322 let val = bx.function_parameter_values.borrow()[&bx.current_fn.def(bx)][*idx];
323 *idx += 1;
324 val
325 }
326 match arg_abi.mode {
327 PassMode::Ignore => {}
328 PassMode::Direct(_) => {
329 OperandValue::Immediate(next(self, idx)).store(self, dst);
330 }
331 PassMode::Pair(..) => {
332 OperandValue::Pair(next(self, idx), next(self, idx)).store(self, dst);
333 }
334 PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
335 self.span(),
336 "query hooks should've made this `PassMode` impossible: {:#?}",
337 arg_abi
338 ),
339 }
340 }
341
342 fn store_arg(
343 &mut self,

Callers

nothing calls this directly

Calls 1

storeMethod · 0.45

Tested by

no test coverage detected