Struct rustc_codegen_llvm::builder::Builder
source · pub struct Builder<'a, 'll, 'tcx> {
pub llbuilder: &'ll mut Builder<'ll>,
pub cx: &'a CodegenCx<'ll, 'tcx>,
}
Fields
llbuilder: &'ll mut Builder<'ll>
cx: &'a CodegenCx<'ll, 'tcx>
Implementations
sourceimpl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx>
impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx>
fn with_cx(cx: &'a CodegenCx<'ll, 'tcx>) -> Self
pub fn llfn(&self) -> &'ll Value
fn position_at_start(&mut self, llbb: &'ll BasicBlock)
fn align_metadata(&mut self, load: &'ll Value, align: Align)
fn noundef_metadata(&mut self, load: &'ll Value)
pub fn minnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
pub fn maxnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
pub fn insert_element(
&mut self,
vec: &'ll Value,
elt: &'ll Value,
idx: &'ll Value
) -> &'ll Value
pub fn shuffle_vector(
&mut self,
v1: &'ll Value,
v2: &'ll Value,
mask: &'ll Value
) -> &'ll Value
pub fn vector_reduce_fadd(
&mut self,
acc: &'ll Value,
src: &'ll Value
) -> &'ll Value
pub fn vector_reduce_fmul(
&mut self,
acc: &'ll Value,
src: &'ll Value
) -> &'ll Value
pub fn vector_reduce_fadd_fast(
&mut self,
acc: &'ll Value,
src: &'ll Value
) -> &'ll Value
pub fn vector_reduce_fmul_fast(
&mut self,
acc: &'ll Value,
src: &'ll Value
) -> &'ll Value
pub fn vector_reduce_add(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_mul(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_and(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_or(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_xor(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_fmin(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_fmax(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_fmin_fast(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_fmax_fast(&mut self, src: &'ll Value) -> &'ll Value
pub fn vector_reduce_min(
&mut self,
src: &'ll Value,
is_signed: bool
) -> &'ll Value
pub fn vector_reduce_max(
&mut self,
src: &'ll Value,
is_signed: bool
) -> &'ll Value
pub fn add_clause(&mut self, landing_pad: &'ll Value, clause: &'ll Value)
pub fn catch_ret(
&mut self,
funclet: &Funclet<'ll>,
unwind: &'ll BasicBlock
) -> &'ll Value
fn check_store(&mut self, val: &'ll Value, ptr: &'ll Value) -> &'ll Value
fn check_call<'b>(
&mut self,
typ: &str,
fn_ty: &'ll Type,
llfn: &'ll Value,
args: &'b [&'ll Value]
) -> Cow<'b, [&'ll Value]>
pub fn va_arg(&mut self, list: &'ll Value, ty: &'ll Type) -> &'ll Value
pub(crate) fn call_intrinsic(
&mut self,
intrinsic: &str,
args: &[&'ll Value]
) -> &'ll Value
fn call_lifetime_intrinsic(&mut self, intrinsic: &str, ptr: &'ll Value, size: Size)
pub(crate) fn phi(
&mut self,
ty: &'ll Type,
vals: &[&'ll Value],
bbs: &[&'ll BasicBlock]
) -> &'ll Value
fn add_incoming_to_phi(
&mut self,
phi: &'ll Value,
val: &'ll Value,
bb: &'ll BasicBlock
)
fn fptoint_sat(
&mut self,
signed: bool,
val: &'ll Value,
dest_ty: &'ll Type
) -> &'ll Value
pub(crate) fn landing_pad(
&mut self,
ty: &'ll Type,
pers_fn: &'ll Value,
num_clauses: usize
) -> &'ll Value
Methods from Deref<Target = CodegenCx<'ll, 'tcx>>
pub fn const_array(&self, ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value
pub fn const_vector(&self, elts: &[&'ll Value]) -> &'ll Value
pub fn const_bytes(&self, bytes: &[u8]) -> &'ll Value
pub fn const_get_elt(&self, v: &'ll Value, idx: u64) -> &'ll Value
pub(crate) fn const_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value
pub(crate) fn static_addr_of_mut(
&self,
cv: &'ll Value,
align: Align,
kind: Option<&str>
) -> &'ll Value
pub(crate) fn get_static(&self, def_id: DefId) -> &'ll Value
pub(crate) fn statics_to_rauw(&self) -> &RefCell<Vec<(&'ll Value, &'ll Value)>>
pub fn coverage_context(&self) -> Option<&CrateCoverageContext<'ll, 'tcx>>
fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'ll Value])
pub(crate) fn get_intrinsic(&self, key: &str) -> (&'ll Type, &'ll Value)
fn insert_intrinsic(
&self,
name: &'static str,
args: Option<&[&'ll Type]>,
ret: &'ll Type
) -> (&'ll Type, &'ll Value)
fn declare_intrinsic(&self, key: &str) -> Option<(&'ll Type, &'ll Value)>
pub(crate) fn eh_catch_typeinfo(&self) -> &'ll Value
sourcepub fn generate_local_symbol_name(&self, prefix: &str) -> String
pub fn generate_local_symbol_name(&self, prefix: &str) -> String
Generates a new symbol name with the given prefix. This symbol name must
only be used for definitions with internal
or private
linkage.
sourcepub fn lookup_debug_loc(&self, pos: BytePos) -> DebugLoc
pub fn lookup_debug_loc(&self, pos: BytePos) -> DebugLoc
Looks up debug source information about a BytePos
.
sourcepub fn declare_global(&self, name: &str, ty: &'ll Type) -> &'ll Value
pub fn declare_global(&self, name: &str, ty: &'ll Type) -> &'ll Value
Declare a global value.
If there’s a value with the same name already declared, the function will return its Value instead.
sourcepub fn declare_cfn(
&self,
name: &str,
unnamed: UnnamedAddr,
fn_type: &'ll Type
) -> &'ll Value
pub fn declare_cfn(
&self,
name: &str,
unnamed: UnnamedAddr,
fn_type: &'ll Type
) -> &'ll Value
Declare a C ABI function.
Only use this for foreign function ABIs and glue. For Rust functions use
declare_fn
instead.
If there’s a value with the same name already declared, the function will update the declaration and return existing Value instead.
sourcepub fn declare_fn(&self, name: &str, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> &'ll Value
pub fn declare_fn(&self, name: &str, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> &'ll Value
Declare a Rust function.
If there’s a value with the same name already declared, the function will update the declaration and return existing Value instead.
sourcepub fn define_global(&self, name: &str, ty: &'ll Type) -> Option<&'ll Value>
pub fn define_global(&self, name: &str, ty: &'ll Type) -> Option<&'ll Value>
Declare a global with an intention to define it.
Use this function when you intend to define a global. This function will
return None
if the name already has a definition associated with it. In that
case an error should be reported to the user, because it usually happens due
to user’s fault (e.g., misuse of #[no_mangle]
or #[export_name]
attributes).
sourcepub fn define_private_global(&self, ty: &'ll Type) -> &'ll Value
pub fn define_private_global(&self, ty: &'ll Type) -> &'ll Value
Declare a private global
Use this function when you intend to define a global without a name.
sourcepub fn get_declared_value(&self, name: &str) -> Option<&'ll Value>
pub fn get_declared_value(&self, name: &str) -> Option<&'ll Value>
Gets declared value by name.
sourcepub fn get_defined_value(&self, name: &str) -> Option<&'ll Value>
pub fn get_defined_value(&self, name: &str) -> Option<&'ll Value>
Gets defined or externally defined (AvailableExternally linkage) value by name.
sourcepub(crate) unsafe fn should_assume_dso_local(
&self,
llval: &Value,
is_declaration: bool
) -> bool
pub(crate) unsafe fn should_assume_dso_local(
&self,
llval: &Value,
is_declaration: bool
) -> bool
Whether a definition or declaration can be assumed to be local to a group of libraries that form a single DSO or executable.
pub(crate) fn type_named_struct(&self, name: &str) -> &'ll Type
pub(crate) fn set_struct_body(
&self,
ty: &'ll Type,
els: &[&'ll Type],
packed: bool
)
pub(crate) fn type_void(&self) -> &'ll Type
pub(crate) fn type_metadata(&self) -> &'ll Type
sourcepub(crate) fn type_ix(&self, num_bits: u64) -> &'ll Type
pub(crate) fn type_ix(&self, num_bits: u64) -> &'ll Type
x Creates an integer type with the given number of bits, e.g., i24
pub(crate) fn type_vector(&self, ty: &'ll Type, len: u64) -> &'ll Type
pub(crate) fn func_params_types(&self, ty: &'ll Type) -> Vec<&'ll Type>
pub(crate) fn type_bool(&self) -> &'ll Type
pub(crate) fn type_int_from_ty(&self, t: IntTy) -> &'ll Type
pub(crate) fn type_uint_from_ty(&self, t: UintTy) -> &'ll Type
pub(crate) fn type_float_from_ty(&self, t: FloatTy) -> &'ll Type
pub(crate) fn type_pointee_for_align(&self, align: Align) -> &'ll Type
sourcepub(crate) fn type_padding_filler(&self, size: Size, align: Align) -> &'ll Type
pub(crate) fn type_padding_filler(&self, size: Size, align: Align) -> &'ll Type
Return a LLVM type that has at most the required alignment, and exactly the required size, as a best-effort padding array.
pub(crate) fn type_variadic_func(
&self,
args: &[&'ll Type],
ret: &'ll Type
) -> &'ll Type
pub(crate) fn type_array(&self, ty: &'ll Type, len: u64) -> &'ll Type
Trait Implementations
sourceimpl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>
impl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>
sourceimpl<'ll, 'tcx> ArgAbiMethods<'tcx> for Builder<'_, 'll, 'tcx>
impl<'ll, 'tcx> ArgAbiMethods<'tcx> for Builder<'_, 'll, 'tcx>
fn store_fn_arg(
&mut self,
arg_abi: &ArgAbi<'tcx, Ty<'tcx>>,
idx: &mut usize,
dst: PlaceRef<'tcx, Self::Value>
)
fn store_arg(
&mut self,
arg_abi: &ArgAbi<'tcx, Ty<'tcx>>,
val: &'ll Value,
dst: PlaceRef<'tcx, &'ll Value>
)
fn arg_memory_ty(&self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>) -> &'ll Type
sourceimpl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx>
impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx>
sourcefn codegen_inline_asm(
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[InlineAsmOperandRef<'tcx, Self>],
options: InlineAsmOptions,
line_spans: &[Span],
instance: Instance<'_>,
dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>
)
fn codegen_inline_asm(
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[InlineAsmOperandRef<'tcx, Self>],
options: InlineAsmOptions,
line_spans: &[Span],
instance: Instance<'_>,
dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>
)
sourceimpl<'ll, 'tcx> BackendTypes for Builder<'_, 'll, 'tcx>
impl<'ll, 'tcx> BackendTypes for Builder<'_, 'll, 'tcx>
type Value = &'ll Value
type Function = &'ll Value
type BasicBlock = &'ll BasicBlock
type Type = &'ll Type
type Funclet = Funclet<'ll>
type DIScope = &'ll Metadata
type DILocation = &'ll Metadata
type DIVariable = &'ll Metadata
sourceimpl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx>
impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx>
fn build(cx: &'a CodegenCx<'ll, 'tcx>, llbb: &'ll BasicBlock) -> Self
fn cx(&self) -> &CodegenCx<'ll, 'tcx>
fn llbb(&self) -> &'ll BasicBlock
fn set_span(&mut self, _span: Span)
fn append_block(
cx: &'a CodegenCx<'ll, 'tcx>,
llfn: &'ll Value,
name: &str
) -> &'ll BasicBlock
fn append_sibling_block(&mut self, name: &str) -> &'ll BasicBlock
fn switch_to_block(&mut self, llbb: Self::BasicBlock)
fn ret_void(&mut self)
fn ret(&mut self, v: &'ll Value)
fn br(&mut self, dest: &'ll BasicBlock)
fn cond_br(
&mut self,
cond: &'ll Value,
then_llbb: &'ll BasicBlock,
else_llbb: &'ll BasicBlock
)
fn switch(
&mut self,
v: &'ll Value,
else_llbb: &'ll BasicBlock,
cases: impl ExactSizeIterator<Item = (u128, &'ll BasicBlock)>
)
fn invoke(
&mut self,
llty: &'ll Type,
llfn: &'ll Value,
args: &[&'ll Value],
then: &'ll BasicBlock,
catch: &'ll BasicBlock,
funclet: Option<&Funclet<'ll>>
) -> &'ll Value
fn unreachable(&mut self)
fn add(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn fadd(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn sub(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn fsub(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn mul(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn fmul(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn udiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn exactudiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn sdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn exactsdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn fdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn urem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn srem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn frem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn shl(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn lshr(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn ashr(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn and(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn or(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn xor(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value
fn neg(&mut self, x: &'ll Value) -> &'ll Value
fn fneg(&mut self, x: &'ll Value) -> &'ll Value
fn not(&mut self, x: &'ll Value) -> &'ll Value
fn unchecked_sadd(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn unchecked_uadd(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn unchecked_ssub(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn unchecked_usub(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn unchecked_smul(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn unchecked_umul(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value
fn fadd_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
fn fsub_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
fn fmul_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
fn fdiv_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
fn frem_fast(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value
fn checked_binop(
&mut self,
oop: OverflowOp,
ty: Ty<'_>,
lhs: Self::Value,
rhs: Self::Value
) -> (Self::Value, Self::Value)
fn from_immediate(&mut self, val: Self::Value) -> Self::Value
fn to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value
fn alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value
fn dynamic_alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value
fn array_alloca(
&mut self,
ty: &'ll Type,
len: &'ll Value,
align: Align
) -> &'ll Value
fn load(&mut self, ty: &'ll Type, ptr: &'ll Value, align: Align) -> &'ll Value
fn volatile_load(&mut self, ty: &'ll Type, ptr: &'ll Value) -> &'ll Value
fn atomic_load(
&mut self,
ty: &'ll Type,
ptr: &'ll Value,
order: AtomicOrdering,
size: Size
) -> &'ll Value
fn load_operand(
&mut self,
place: PlaceRef<'tcx, &'ll Value>
) -> OperandRef<'tcx, &'ll Value>
sourcefn write_operand_repeatedly(
self,
cg_elem: OperandRef<'tcx, &'ll Value>,
count: u64,
dest: PlaceRef<'tcx, &'ll Value>
) -> Self
fn write_operand_repeatedly(
self,
cg_elem: OperandRef<'tcx, &'ll Value>,
count: u64,
dest: PlaceRef<'tcx, &'ll Value>
) -> Self
fn range_metadata(&mut self, load: &'ll Value, range: WrappingRange)
fn nonnull_metadata(&mut self, load: &'ll Value)
fn store(&mut self, val: &'ll Value, ptr: &'ll Value, align: Align) -> &'ll Value
fn store_with_flags(
&mut self,
val: &'ll Value,
ptr: &'ll Value,
align: Align,
flags: MemFlags
) -> &'ll Value
fn atomic_store(
&mut self,
val: &'ll Value,
ptr: &'ll Value,
order: AtomicOrdering,
size: Size
)
fn gep(
&mut self,
ty: &'ll Type,
ptr: &'ll Value,
indices: &[&'ll Value]
) -> &'ll Value
fn inbounds_gep(
&mut self,
ty: &'ll Type,
ptr: &'ll Value,
indices: &[&'ll Value]
) -> &'ll Value
fn struct_gep(&mut self, ty: &'ll Type, ptr: &'ll Value, idx: u64) -> &'ll Value
fn trunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn sext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fptoui_sat(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fptosi_sat(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fptoui(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fptosi(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn uitofp(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn sitofp(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fptrunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn fpext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn ptrtoint(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn inttoptr(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn bitcast(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn intcast(
&mut self,
val: &'ll Value,
dest_ty: &'ll Type,
is_signed: bool
) -> &'ll Value
fn pointercast(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn icmp(
&mut self,
op: IntPredicate,
lhs: &'ll Value,
rhs: &'ll Value
) -> &'ll Value
fn fcmp(
&mut self,
op: RealPredicate,
lhs: &'ll Value,
rhs: &'ll Value
) -> &'ll Value
fn memcpy(
&mut self,
dst: &'ll Value,
dst_align: Align,
src: &'ll Value,
src_align: Align,
size: &'ll Value,
flags: MemFlags
)
fn memmove(
&mut self,
dst: &'ll Value,
dst_align: Align,
src: &'ll Value,
src_align: Align,
size: &'ll Value,
flags: MemFlags
)
fn memset(
&mut self,
ptr: &'ll Value,
fill_byte: &'ll Value,
size: &'ll Value,
align: Align,
flags: MemFlags
)
fn select(
&mut self,
cond: &'ll Value,
then_val: &'ll Value,
else_val: &'ll Value
) -> &'ll Value
fn va_arg(&mut self, list: &'ll Value, ty: &'ll Type) -> &'ll Value
fn extract_element(&mut self, vec: &'ll Value, idx: &'ll Value) -> &'ll Value
fn vector_splat(&mut self, num_elts: usize, elt: &'ll Value) -> &'ll Value
fn extract_value(&mut self, agg_val: &'ll Value, idx: u64) -> &'ll Value
fn insert_value(
&mut self,
agg_val: &'ll Value,
elt: &'ll Value,
idx: u64
) -> &'ll Value
fn set_personality_fn(&mut self, personality: &'ll Value)
fn cleanup_landing_pad(
&mut self,
ty: &'ll Type,
pers_fn: &'ll Value
) -> &'ll Value
fn resume(&mut self, exn: &'ll Value)
fn cleanup_pad(
&mut self,
parent: Option<&'ll Value>,
args: &[&'ll Value]
) -> Funclet<'ll>
fn cleanup_ret(&mut self, funclet: &Funclet<'ll>, unwind: Option<&'ll BasicBlock>)
fn catch_pad(&mut self, parent: &'ll Value, args: &[&'ll Value]) -> Funclet<'ll>
fn catch_switch(
&mut self,
parent: Option<&'ll Value>,
unwind: Option<&'ll BasicBlock>,
handlers: &[&'ll BasicBlock]
) -> &'ll Value
fn atomic_cmpxchg(
&mut self,
dst: &'ll Value,
cmp: &'ll Value,
src: &'ll Value,
order: AtomicOrdering,
failure_order: AtomicOrdering,
weak: bool
) -> &'ll Value
fn atomic_rmw(
&mut self,
op: AtomicRmwBinOp,
dst: &'ll Value,
src: &'ll Value,
order: AtomicOrdering
) -> &'ll Value
fn atomic_fence(&mut self, order: AtomicOrdering, scope: SynchronizationScope)
fn set_invariant_load(&mut self, load: &'ll Value)
sourcefn lifetime_start(&mut self, ptr: &'ll Value, size: Size)
fn lifetime_start(&mut self, ptr: &'ll Value, size: Size)
StorageLive
sourcefn lifetime_end(&mut self, ptr: &'ll Value, size: Size)
fn lifetime_end(&mut self, ptr: &'ll Value, size: Size)
StorageDead
fn instrprof_increment(
&mut self,
fn_name: &'ll Value,
hash: &'ll Value,
num_counters: &'ll Value,
index: &'ll Value
)
fn call(
&mut self,
llty: &'ll Type,
llfn: &'ll Value,
args: &[&'ll Value],
funclet: Option<&Funclet<'ll>>
) -> &'ll Value
fn zext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value
fn do_not_inline(&mut self, llret: &'ll Value)
fn to_immediate(
&mut self,
val: Self::Value,
layout: TyAndLayout<'_, Ty<'_>>
) -> Self::Value
fn cast_float_to_int(
&mut self,
signed: bool,
x: Self::Value,
dest_ty: Self::Type
) -> Self::Value
sourceimpl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>
impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>
sourcefn set_function_source_hash(
&mut self,
instance: Instance<'tcx>,
function_source_hash: u64
) -> bool
fn set_function_source_hash(
&mut self,
instance: Instance<'tcx>,
function_source_hash: u64
) -> bool
-C instrument-coverage
is
not enabled (a coverage map is not being generated). Read moresourcefn add_coverage_counter(
&mut self,
instance: Instance<'tcx>,
id: CounterValueReference,
region: CodeRegion
) -> bool
fn add_coverage_counter(
&mut self,
instance: Instance<'tcx>,
id: CounterValueReference,
region: CodeRegion
) -> bool
-C instrument-coverage
is not enabled (a coverage map is not being generated). Read moresourcefn add_coverage_counter_expression(
&mut self,
instance: Instance<'tcx>,
id: InjectedExpressionId,
lhs: ExpressionOperandId,
op: Op,
rhs: ExpressionOperandId,
region: Option<CodeRegion>
) -> bool
fn add_coverage_counter_expression(
&mut self,
instance: Instance<'tcx>,
id: InjectedExpressionId,
lhs: ExpressionOperandId,
op: Op,
rhs: ExpressionOperandId,
region: Option<CodeRegion>
) -> bool
-C instrument-coverage
is not enabled (a coverage map is not being generated). Read moresourcefn add_coverage_unreachable(
&mut self,
instance: Instance<'tcx>,
region: CodeRegion
) -> bool
fn add_coverage_unreachable(
&mut self,
instance: Instance<'tcx>,
region: CodeRegion
) -> bool
-C instrument-coverage
is not enabled (a coverage map is not being generated). Read moresourceimpl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_>
impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_>
fn dbg_var_addr(
&mut self,
dbg_var: &'ll DIVariable,
dbg_loc: &'ll DILocation,
variable_alloca: Self::Value,
direct_offset: Size,
indirect_offsets: &[Size]
)
fn set_dbg_loc(&mut self, dbg_loc: &'ll DILocation)
fn insert_reference_to_gdb_debug_scripts_section_global(&mut self)
fn set_var_name(&mut self, value: &'ll Value, name: &str)
sourceimpl<'tcx> FnAbiOfHelpers<'tcx> for Builder<'_, '_, 'tcx>
impl<'tcx> FnAbiOfHelpers<'tcx> for Builder<'_, '_, 'tcx>
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>
&FnAbi
-wrapping type (or &FnAbi
itself), which will be
returned from fn_abi_of_*
(see also handle_fn_abi_err
). Read moresourcefn handle_fn_abi_err(
&self,
err: FnAbiError<'tcx>,
span: Span,
fn_abi_request: FnAbiRequest<'tcx>
) -> !
fn handle_fn_abi_err(
&self,
err: FnAbiError<'tcx>,
span: Span,
fn_abi_request: FnAbiRequest<'tcx>
) -> !
fn_abi_of_*
, to adapt tcx.fn_abi_of_*(...)
into a
Self::FnAbiOfResult
(which does not need to be a Result<...>
). Read moresourceimpl<'ll, 'tcx> HasCodegen<'tcx> for Builder<'_, 'll, 'tcx>
impl<'ll, 'tcx> HasCodegen<'tcx> for Builder<'_, 'll, 'tcx>
sourceimpl HasDataLayout for Builder<'_, '_, '_>
impl HasDataLayout for Builder<'_, '_, '_>
fn data_layout(&self) -> &TargetDataLayout
sourceimpl<'tcx> HasParamEnv<'tcx> for Builder<'_, '_, 'tcx>
impl<'tcx> HasParamEnv<'tcx> for Builder<'_, '_, 'tcx>
sourceimpl HasTargetSpec for Builder<'_, '_, '_>
impl HasTargetSpec for Builder<'_, '_, '_>
fn target_spec(&self) -> &Target
sourceimpl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx>
impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx>
sourcefn codegen_intrinsic_call(
&mut self,
instance: Instance<'tcx>,
fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
args: &[OperandRef<'tcx, &'ll Value>],
llresult: &'ll Value,
span: Span
)
fn codegen_intrinsic_call(
&mut self,
instance: Instance<'tcx>,
fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
args: &[OperandRef<'tcx, &'ll Value>],
llresult: &'ll Value,
span: Span
)
compiler/rustc_typeck/src/check/mod.rs
,
and in library/core/src/intrinsics.rs
; if you need access to any LLVM intrinsics,
add them to compiler/rustc_codegen_llvm/src/context.rs
. Read morefn abort(&mut self)
fn assume(&mut self, val: Self::Value)
fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value
sourcefn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value
fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value
sourcefn type_checked_load(
&mut self,
llvtable: &'ll Value,
vtable_byte_offset: u64,
typeid: &'ll Value
) -> Self::Value
fn type_checked_load(
&mut self,
llvtable: &'ll Value,
vtable_byte_offset: u64,
typeid: &'ll Value
) -> Self::Value
sourceimpl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, '_, 'tcx>
impl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, '_, 'tcx>
type LayoutOfResult = TyAndLayout<'tcx, Ty<'tcx>>
type LayoutOfResult = TyAndLayout<'tcx, Ty<'tcx>>
TyAndLayout
-wrapping type (or TyAndLayout
itself), which will be
returned from layout_of
(see also handle_layout_err
). Read moresourcefn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> !
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> !
layout_of
, to adapt tcx.layout_of(...)
into a
Self::LayoutOfResult
(which does not need to be a Result<...>
). Read moresourcefn layout_tcx_at_span(&self) -> Span
fn layout_tcx_at_span(&self) -> Span
Span
to use for tcx.at(span)
, from layout_of
.sourceimpl<'ll> StaticBuilderMethods for Builder<'_, 'll, '_>
impl<'ll> StaticBuilderMethods for Builder<'_, 'll, '_>
fn get_static(&mut self, def_id: DefId) -> &'ll Value
Auto Trait Implementations
impl<'a, 'll, 'tcx> !RefUnwindSafe for Builder<'a, 'll, 'tcx>
impl<'a, 'll, 'tcx> !Send for Builder<'a, 'll, 'tcx>
impl<'a, 'll, 'tcx> !Sync for Builder<'a, 'll, 'tcx>
impl<'a, 'll, 'tcx> Unpin for Builder<'a, 'll, 'tcx>where
'll: 'a,
'tcx: 'a,
impl<'a, 'll, 'tcx> !UnwindSafe for Builder<'a, 'll, 'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<'tcx, C> FnAbiOf<'tcx> for Cwhere
C: FnAbiOfHelpers<'tcx>,
impl<'tcx, C> FnAbiOf<'tcx> for Cwhere
C: FnAbiOfHelpers<'tcx>,
sourcefn fn_abi_of_fn_ptr(
&self,
sig: Binder<'tcx, FnSig<'tcx>>,
extra_args: &'tcx List<Ty<'tcx>>
) -> Self::FnAbiOfResult
fn fn_abi_of_fn_ptr(
&self,
sig: Binder<'tcx, FnSig<'tcx>>,
extra_args: &'tcx List<Ty<'tcx>>
) -> Self::FnAbiOfResult
sourcefn fn_abi_of_instance(
&self,
instance: Instance<'tcx>,
extra_args: &'tcx List<Ty<'tcx>>
) -> Self::FnAbiOfResult
fn fn_abi_of_instance(
&self,
instance: Instance<'tcx>,
extra_args: &'tcx List<Ty<'tcx>>
) -> Self::FnAbiOfResult
FnAbi
suitable for declaring/defining an fn
instance, and for
direct calls to an fn
. Read moresourceimpl<'tcx, C> LayoutOf<'tcx> for Cwhere
C: LayoutOfHelpers<'tcx>,
impl<'tcx, C> LayoutOf<'tcx> for Cwhere
C: LayoutOfHelpers<'tcx>,
sourcefn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult
fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult
sourcefn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult
fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult
span
. Note that this implicitly
executes in “reveal all” mode, and will normalize the input type. Read moreLayout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes