Skip to main content

Module traits

Module traits 

Source
Expand description

Interface of a Rust codegen backend

This crate defines all the traits that have to be implemented by a codegen backend in order to use the backend-agnostic codegen code in rustc_codegen_ssa.

The interface is designed around two backend-specific data structures, the codegen context and the builder. The codegen context is supposed to be read-only after its creation and during the actual codegen, while the builder stores the information about the function during codegen and is used to produce the instructions of the backend IR.

The traits contain associated types that are backend-specific, such as the backend’s value or basic blocks.

Re-exportsΒ§

use std::fmt; πŸ”’
use rustc_middle::ty::Ty; πŸ”’
use rustc_middle::ty::layout::FnAbiOf; πŸ”’
use rustc_middle::ty::layout::LayoutOf; πŸ”’
use rustc_middle::ty::layout::TyAndLayout; πŸ”’
use rustc_target::callconv::FnAbi; πŸ”’
pub use self::abi::AbiBuilderMethods;
pub use self::asm::AsmBuilderMethods;
pub use self::asm::AsmCodegenMethods;
pub use self::asm::GlobalAsmOperandRef;
pub use self::asm::InlineAsmOperandRef;
pub use self::backend::BackendTypes;
pub use self::backend::CodegenBackend;
pub use self::backend::ExtraBackendMethods;
pub use self::builder::BuilderMethods;
pub use self::builder::OverflowOp;
pub use self::builder::ReturnSlot;
pub use self::consts::ConstCodegenMethods;
pub use self::coverageinfo::CoverageInfoBuilderMethods;
pub use self::debuginfo::DebugInfoBuilderMethods;
pub use self::debuginfo::DebugInfoCodegenMethods;
pub use self::declare::PreDefineCodegenMethods;
pub use self::intrinsic::IntrinsicCallBuilderMethods;
pub use self::misc::MiscCodegenMethods;
pub use self::statics::StaticBuilderMethods;
pub use self::statics::StaticCodegenMethods;
pub use self::type_::ArgAbiBuilderMethods;
pub use self::type_::BaseTypeCodegenMethods;
pub use self::type_::DerivedTypeCodegenMethods;
pub use self::type_::LayoutTypeCodegenMethods;
pub use self::type_::TypeCodegenMethods;
pub use self::type_::TypeMembershipCodegenMethods;
pub use self::write::ModuleBufferMethods;
pub use self::write::WriteBackendMethods;

ModulesΒ§

abi πŸ”’
asm πŸ”’
backend πŸ”’
builder πŸ”’
consts πŸ”’
coverageinfo πŸ”’
debuginfo πŸ”’
declare πŸ”’
intrinsic πŸ”’
misc πŸ”’
statics πŸ”’
type_ πŸ”’
write πŸ”’

Trait AliasesΒ§

CodegenMethods
CodegenObject