Trait rustc_codegen_ssa::traits::WriteBackendMethods
source · [−]pub trait WriteBackendMethods: 'static + Sized + Clone {
type Module: Send + Sync;
type TargetMachine;
type ModuleBuffer: ModuleBufferMethods;
type Context: ?Sized;
type ThinData: Send + Sync;
type ThinBuffer: ThinBufferMethods;
fn run_link(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
modules: Vec<ModuleCodegen<Self::Module>>
) -> Result<ModuleCodegen<Self::Module>, FatalError>;
fn run_fat_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<FatLTOInput<Self>>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<LtoModuleCodegen<Self>, FatalError>;
fn run_thin_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<(String, Self::ThinBuffer)>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<(Vec<LtoModuleCodegen<Self>>, Vec<WorkProduct>), FatalError>;
fn print_pass_timings(&self);
unsafe fn optimize(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
module: &ModuleCodegen<Self::Module>,
config: &ModuleConfig
) -> Result<(), FatalError>;
fn optimize_fat(
cgcx: &CodegenContext<Self>,
llmod: &mut ModuleCodegen<Self::Module>
) -> Result<(), FatalError>;
unsafe fn optimize_thin(
cgcx: &CodegenContext<Self>,
thin: ThinModule<Self>
) -> Result<ModuleCodegen<Self::Module>, FatalError>;
unsafe fn codegen(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
module: ModuleCodegen<Self::Module>,
config: &ModuleConfig
) -> Result<CompiledModule, FatalError>;
fn prepare_thin(
module: ModuleCodegen<Self::Module>
) -> (String, Self::ThinBuffer);
fn serialize_module(
module: ModuleCodegen<Self::Module>
) -> (String, Self::ModuleBuffer);
}
Required Associated Types
source
type TargetMachine
Required Methods
sourcefn run_link(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
modules: Vec<ModuleCodegen<Self::Module>>
) -> Result<ModuleCodegen<Self::Module>, FatalError>
fn run_link(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
modules: Vec<ModuleCodegen<Self::Module>>
) -> Result<ModuleCodegen<Self::Module>, FatalError>
Merge all modules into main_module and returning it
sourcefn run_fat_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<FatLTOInput<Self>>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<LtoModuleCodegen<Self>, FatalError>
fn run_fat_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<FatLTOInput<Self>>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<LtoModuleCodegen<Self>, FatalError>
Performs fat LTO by merging all modules into a single one and returning it for further optimization.
sourcefn run_thin_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<(String, Self::ThinBuffer)>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<(Vec<LtoModuleCodegen<Self>>, Vec<WorkProduct>), FatalError>
fn run_thin_lto(
cgcx: &CodegenContext<Self>,
modules: Vec<(String, Self::ThinBuffer)>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>
) -> Result<(Vec<LtoModuleCodegen<Self>>, Vec<WorkProduct>), FatalError>
Performs thin LTO by performing necessary global analysis and returning two lists, one of the modules that need optimization and another for modules that can simply be copied over from the incr. comp. cache.
source
fn print_pass_timings(&self)
sourceunsafe fn optimize(
unsafe fn optimize(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
module: &ModuleCodegen<Self::Module>,
config: &ModuleConfig
) -> Result<(), FatalError>
sourcefn optimize_fat(
fn optimize_fat(
cgcx: &CodegenContext<Self>,
llmod: &mut ModuleCodegen<Self::Module>
) -> Result<(), FatalError>
sourceunsafe fn optimize_thin(
unsafe fn optimize_thin(
cgcx: &CodegenContext<Self>,
thin: ThinModule<Self>
) -> Result<ModuleCodegen<Self::Module>, FatalError>
sourceunsafe fn codegen(
unsafe fn codegen(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
module: ModuleCodegen<Self::Module>,
config: &ModuleConfig
) -> Result<CompiledModule, FatalError>
sourcefn prepare_thin(
fn prepare_thin(
module: ModuleCodegen<Self::Module>
) -> (String, Self::ThinBuffer)
sourcefn serialize_module(