Skip to main content

ExtraBackendMethods

Trait ExtraBackendMethods 

Source
pub trait ExtraBackendMethods:
    WriteBackendMethods
    + Sized
    + Send
    + Sync
    + DynSend
    + DynSync {
    // Required methods
    fn codegen_allocator<'tcx>(
        &self,
        tcx: TyCtxt<'tcx>,
        module_name: &str,
        methods: &[AllocatorMethod],
    ) -> Self::Module;
    fn compile_codegen_unit(
        &self,
        tcx: TyCtxt<'_>,
        cgu_name: Symbol,
    ) -> (ModuleCodegen<Self::Module>, u64);

    // Provided method
    fn supports_parallel(&self) -> bool { ... }
}

Required Methods§

Source

fn codegen_allocator<'tcx>( &self, tcx: TyCtxt<'tcx>, module_name: &str, methods: &[AllocatorMethod], ) -> Self::Module

Source

fn compile_codegen_unit( &self, tcx: TyCtxt<'_>, cgu_name: Symbol, ) -> (ModuleCodegen<Self::Module>, u64)

This generates the codegen unit and returns it along with a u64 giving an estimate of the unit’s processing cost.

Provided Methods§

Source

fn supports_parallel(&self) -> bool

Returns true if this backend can be safely called from multiple threads.

Defaults to true.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§