Trait rustc_codegen_ssa::traits::CodegenBackend
source · pub trait CodegenBackend {
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,
metadata: EncodedMetadata,
need_metadata_module: bool
) -> Box<dyn Any>;
fn join_codegen(
&self,
ongoing_codegen: Box<dyn Any>,
sess: &Session,
outputs: &OutputFilenames
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorGuaranteed>;
fn link(
&self,
sess: &Session,
codegen_results: CodegenResults,
outputs: &OutputFilenames
) -> Result<(), ErrorGuaranteed>;
fn init(&self, _sess: &Session) { ... }
fn print(&self, _req: PrintRequest, _sess: &Session) { ... }
fn target_features(
&self,
_sess: &Session,
_allow_unstable: bool
) -> Vec<Symbol> { ... }
fn print_passes(&self) { ... }
fn print_version(&self) { ... }
fn target_override(&self, _opts: &Options) -> Option<Target> { ... }
fn metadata_loader(&self) -> Box<MetadataLoaderDyn> { ... }
fn provide(&self, _providers: &mut Providers) { ... }
fn provide_extern(&self, _providers: &mut ExternProviders) { ... }
}
Required Methods
sourcefn codegen_crate<'tcx>(
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,
metadata: EncodedMetadata,
need_metadata_module: bool
) -> Box<dyn Any>
sourcefn join_codegen(
&self,
ongoing_codegen: Box<dyn Any>,
sess: &Session,
outputs: &OutputFilenames
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorGuaranteed>
fn join_codegen(
&self,
ongoing_codegen: Box<dyn Any>,
sess: &Session,
outputs: &OutputFilenames
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorGuaranteed>
This is called on the returned Box<dyn Any>
from codegen_backend
Panics
Panics when the passed Box<dyn Any>
was not returned by codegen_backend
.
sourcefn link(
&self,
sess: &Session,
codegen_results: CodegenResults,
outputs: &OutputFilenames
) -> Result<(), ErrorGuaranteed>
fn link(
&self,
sess: &Session,
codegen_results: CodegenResults,
outputs: &OutputFilenames
) -> Result<(), ErrorGuaranteed>
This is called on the returned Box<dyn Any>
from join_codegen
Panics
Panics when the passed Box<dyn Any>
was not returned by join_codegen
.
Provided Methods
source
fn print(&self, _req: PrintRequest, _sess: &Session)
source
fn print_passes(&self)
source
fn print_version(&self)
sourcefn target_override(&self, _opts: &Options) -> Option<Target>
fn target_override(&self, _opts: &Options) -> Option<Target>
If this plugin provides additional builtin targets, provide the one enabled by the options here. Be careful: this is called before init() is called.
sourcefn metadata_loader(&self) -> Box<MetadataLoaderDyn>
fn metadata_loader(&self) -> Box<MetadataLoaderDyn>
The metadata loader used to load rlib and dylib metadata.
Alternative codegen backends may want to use different rlib or dylib formats than the default native static archives and dynamic libraries.
source