pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
    fn scalar_to_carg(
        k: Scalar<Provenance>,
        arg_type: Ty<'tcx>,
        cx: &impl HasDataLayout
    ) -> InterpResult<'tcx, CArg> { ... } fn call_external_c_and_store_return<'a>(
        &mut self,
        link_name: Symbol,
        dest: &PlaceTy<'tcx, Provenance>,
        ptr: CodePtr,
        libffi_args: Vec<Arg<'a>>
    ) -> InterpResult<'tcx, ()> { ... } fn get_func_ptr_explicitly_from_lib(
        &mut self,
        link_name: Symbol
    ) -> Option<CodePtr> { ... } fn call_external_c_fct(
        &mut self,
        link_name: Symbol,
        dest: &PlaceTy<'tcx, Provenance>,
        args: &[OpTy<'tcx, Provenance>]
    ) -> InterpResult<'tcx, bool> { ... } }

Provided Methods§

Extract the scalar value from the result of reading a scalar from the machine, and convert it to a CArg.

Call external C function and store output, depending on return type in the function signature.

Get the pointer to the function of the specified name in the shared object file, if it exists. The function must be in the shared object file specified: we do not return pointers to functions in dependencies of the library.

Call specified external C function, with supplied arguments. Need to convert all the arguments from their hir representations to a form compatible with C (through libffi call). Then, convert return from the C call into a corresponding form that can be stored in Miri internal memory.

Implementors§