rustc_codegen_llvm::builder

Struct Builder

Source
pub(crate) 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§

Source§

impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx>

Source

fn with_cx(cx: &'a CodegenCx<'ll, 'tcx>) -> Self

Source

pub(crate) fn llfn(&self) -> &'ll Value

Source

fn position_at_start(&mut self, llbb: &'ll BasicBlock)

Source

fn align_metadata(&mut self, load: &'ll Value, align: Align)

Source

fn noundef_metadata(&mut self, load: &'ll Value)

Source

pub(crate) fn set_unpredictable(&mut self, inst: &'ll Value)

Source

pub(crate) fn minnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value

Source

pub(crate) fn maxnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value

Source

pub(crate) fn insert_element( &mut self, vec: &'ll Value, elt: &'ll Value, idx: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn shuffle_vector( &mut self, v1: &'ll Value, v2: &'ll Value, mask: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_fadd( &mut self, acc: &'ll Value, src: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_fmul( &mut self, acc: &'ll Value, src: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_fadd_reassoc( &mut self, acc: &'ll Value, src: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_fmul_reassoc( &mut self, acc: &'ll Value, src: &'ll Value, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_add(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_mul(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_and(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_or(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_xor(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_fmin(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_fmax(&mut self, src: &'ll Value) -> &'ll Value

Source

pub(crate) fn vector_reduce_min( &mut self, src: &'ll Value, is_signed: bool, ) -> &'ll Value

Source

pub(crate) fn vector_reduce_max( &mut self, src: &'ll Value, is_signed: bool, ) -> &'ll Value

Source

pub(crate) fn add_clause(&mut self, landing_pad: &'ll Value, clause: &'ll Value)

Source

pub(crate) fn catch_ret( &mut self, funclet: &Funclet<'ll>, unwind: &'ll BasicBlock, ) -> &'ll Value

Source

fn check_call<'b>( &mut self, typ: &str, fn_ty: &'ll Type, llfn: &'ll Value, args: &'b [&'ll Value], ) -> Cow<'b, [&'ll Value]>

Source

pub(crate) fn va_arg(&mut self, list: &'ll Value, ty: &'ll Type) -> &'ll Value

Source

pub(crate) fn call_intrinsic( &mut self, intrinsic: &str, args: &[&'ll Value], ) -> &'ll Value

Source

fn call_lifetime_intrinsic( &mut self, intrinsic: &str, ptr: &'ll Value, size: Size, )

Source

pub(crate) fn phi( &mut self, ty: &'ll Type, vals: &[&'ll Value], bbs: &[&'ll BasicBlock], ) -> &'ll Value

Source

fn add_incoming_to_phi( &mut self, phi: &'ll Value, val: &'ll Value, bb: &'ll BasicBlock, )

Source

fn fptoint_sat( &mut self, signed: bool, val: &'ll Value, dest_ty: &'ll Type, ) -> &'ll Value

Source

pub(crate) fn landing_pad( &mut self, ty: &'ll Type, pers_fn: &'ll Value, num_clauses: usize, ) -> &'ll Value

Source

pub(crate) fn callbr( &mut self, llty: &'ll Type, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, llfn: &'ll Value, args: &[&'ll Value], default_dest: &'ll BasicBlock, indirect_dest: &[&'ll BasicBlock], funclet: Option<&Funclet<'ll>>, instance: Option<Instance<'tcx>>, ) -> &'ll Value

Source

fn cfi_type_test( &mut self, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, instance: Option<Instance<'tcx>>, llfn: &'ll Value, )

Source

fn kcfi_operand_bundle( &mut self, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, instance: Option<Instance<'tcx>>, llfn: &'ll Value, ) -> Option<OperandBundleOwned<'ll>>

Source

pub(crate) fn instrprof_increment( &mut self, fn_name: &'ll Value, hash: &'ll Value, num_counters: &'ll Value, index: &'ll Value, )

Emits a call to llvm.instrprof.increment. Used by coverage instrumentation.

Source

pub(crate) fn mcdc_parameters( &mut self, fn_name: &'ll Value, hash: &'ll Value, bitmap_bits: &'ll Value, )

Emits a call to llvm.instrprof.mcdc.parameters.

This doesn’t produce any code directly, but is used as input by the LLVM pass that handles coverage instrumentation.

(See clang’s CodeGenPGO::emitMCDCParameters for comparison.)

Source

pub(crate) fn mcdc_tvbitmap_update( &mut self, fn_name: &'ll Value, hash: &'ll Value, bitmap_index: &'ll Value, mcdc_temp: &'ll Value, )

Source

pub(crate) fn mcdc_condbitmap_reset(&mut self, mcdc_temp: &'ll Value)

Source

pub(crate) fn mcdc_condbitmap_update( &mut self, cond_index: &'ll Value, mcdc_temp: &'ll Value, )

Methods from Deref<Target = CodegenCx<'ll, 'tcx>>§

Source

pub(crate) fn const_array( &self, ty: &'ll Type, elts: &[&'ll Value], ) -> &'ll Value

Source

pub(crate) fn const_bytes(&self, bytes: &[u8]) -> &'ll Value

Source

pub(crate) fn const_get_elt(&self, v: &'ll Value, idx: u64) -> &'ll Value

Source

pub(crate) fn const_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value

Source

pub(crate) fn static_addr_of_mut( &self, cv: &'ll Value, align: Align, kind: Option<&str>, ) -> &'ll Value

Source

pub(crate) fn get_static(&self, def_id: DefId) -> &'ll Value

Source

fn get_static_inner(&self, def_id: DefId, llty: &'ll Type) -> &'ll Value

Source

fn codegen_static_item(&self, def_id: DefId)

Source

pub(crate) fn statics_to_rauw(&self) -> &RefCell<Vec<(&'ll Value, &'ll Value)>>

Source

pub(crate) fn coverage_cx(&self) -> &CrateCoverageContext<'ll, 'tcx>

Extra state that is only available when coverage instrumentation is enabled.

Source

pub(crate) fn create_used_variable_impl( &self, name: &'static CStr, values: &[&'ll Value], )

Source

pub(crate) fn get_intrinsic(&self, key: &str) -> (&'ll Type, &'ll Value)

Source

fn insert_intrinsic( &self, name: &'static str, args: Option<&[&'ll Type]>, ret: &'ll Type, ) -> (&'ll Type, &'ll Value)

Source

fn declare_intrinsic(&self, key: &str) -> Option<(&'ll Type, &'ll Value)>

Source

pub(crate) fn eh_catch_typeinfo(&self) -> &'ll Value

Source

pub(crate) 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.

Source

pub(crate) fn set_metadata<'a>( &self, val: &'a Value, kind_id: MetadataType, md: &'a Metadata, )

A wrapper for llvm::LLVMSetMetadata, but it takes Metadata as a parameter instead of Value.

Source

pub(crate) fn coverageinfo_finalize(&self)

Source

fn covfun_section_name(&self) -> &CStr

Returns the section name to use when embedding per-function coverage information in the object file, according to the target’s object file format. LLVM’s coverage tools use information from this section when producing coverage reports.

Typical values are:

  • __llvm_covfun on Linux
  • __LLVM_COV,__llvm_covfun on macOS (includes __LLVM_COV, segment prefix)
  • .lcovfun$M on Windows (includes $M sorting suffix)
Source

fn get_pgo_func_name_var(&self, instance: Instance<'tcx>) -> &'ll Value

For LLVM codegen, returns a function-specific Value for a global string, to hold the function name passed to LLVM intrinsic instrprof.increment(). The Value is only created once per instance. Multiple invocations with the same instance return the same Value.

Source

fn lookup_debug_loc(&self, pos: BytePos) -> DebugLoc

Looks up debug source information about a BytePos.

Source

pub(crate) 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.

Source

pub(crate) 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.

Source

pub(crate) fn declare_entry_fn( &self, name: &str, callconv: CallConv, unnamed: UnnamedAddr, fn_type: &'ll Type, ) -> &'ll Value

Declare an entry Function

The ABI of this function can change depending on the target (although for now the same as declare_cfn)

If there’s a value with the same name already declared, the function will update the declaration and return existing Value instead.

Source

pub(crate) fn declare_fn( &self, name: &str, fn_abi: &FnAbi<'tcx, Ty<'tcx>>, instance: Option<Instance<'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.

Source

pub(crate) 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).

Source

pub(crate) 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.

Source

pub(crate) fn get_declared_value(&self, name: &str) -> Option<&'ll Value>

Gets declared value by name.

Source

pub(crate) fn get_defined_value(&self, name: &str) -> Option<&'ll Value>

Gets defined or externally defined (AvailableExternally linkage) value by name.

Source

pub(crate) 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.

Source

pub(crate) fn type_named_struct(&self, name: &str) -> &'ll Type

Source

pub(crate) fn set_struct_body( &self, ty: &'ll Type, els: &[&'ll Type], packed: bool, )

Source

pub(crate) fn type_void(&self) -> &'ll Type

Source

pub(crate) fn type_token(&self) -> &'ll Type

Source

pub(crate) fn type_metadata(&self) -> &'ll Type

Source

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

Source

pub(crate) fn type_vector(&self, ty: &'ll Type, len: u64) -> &'ll Type

Source

pub(crate) fn func_params_types(&self, ty: &'ll Type) -> Vec<&'ll Type>

Source

pub(crate) fn type_bool(&self) -> &'ll Type

Source

pub(crate) fn type_int_from_ty(&self, t: IntTy) -> &'ll Type

Source

pub(crate) fn type_uint_from_ty(&self, t: UintTy) -> &'ll Type

Source

pub(crate) fn type_float_from_ty(&self, t: FloatTy) -> &'ll Type

Source

pub(crate) fn type_padding_filler(&self, size: Size, align: Align) -> &'ll Type

Return an LLVM type that has at most the required alignment, and exactly the required size, as a best-effort padding array.

Source

pub(crate) fn type_variadic_func( &self, args: &[&'ll Type], ret: &'ll Type, ) -> &'ll Type

Source

pub(crate) fn type_i1(&self) -> &'ll Type

Source

pub(crate) fn type_struct(&self, els: &[&'ll Type], packed: bool) -> &'ll Type

Source

pub(crate) fn align_of(&self, ty: Ty<'tcx>) -> Align

Source

pub(crate) fn size_of(&self, ty: Ty<'tcx>) -> Size

Source

pub(crate) fn size_and_align_of(&self, ty: Ty<'tcx>) -> (Size, Align)

Trait Implementations§

Source§

impl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn get_param(&mut self, index: usize) -> Self::Value

Source§

impl<'ll, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx>

Source§

fn store_fn_arg( &mut self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>, idx: &mut usize, dst: PlaceRef<'tcx, Self::Value>, )

Source§

fn store_arg( &mut self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>, val: &'ll Value, dst: PlaceRef<'tcx, &'ll Value>, )

Source§

fn arg_memory_ty(&self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>) -> &'ll Type

Source§

impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx>

Source§

fn codegen_inline_asm( &mut self, template: &[InlineAsmTemplatePiece], operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, line_spans: &[Span], instance: Instance<'_>, dest: Option<Self::BasicBlock>, catch_funclet: Option<(Self::BasicBlock, Option<&Self::Funclet>)>, )

Take an inline assembly expression and splat it out via LLVM
Source§

impl<'ll, 'tcx> BackendTypes for Builder<'_, 'll, 'tcx>

Source§

impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx>

Source§

type CodegenCx = CodegenCx<'ll, 'tcx>

Source§

fn build(cx: &'a CodegenCx<'ll, 'tcx>, llbb: &'ll BasicBlock) -> Self

Source§

fn cx(&self) -> &CodegenCx<'ll, 'tcx>

Source§

fn llbb(&self) -> &'ll BasicBlock

Source§

fn set_span(&mut self, _span: Span)

Source§

fn append_block( cx: &'a CodegenCx<'ll, 'tcx>, llfn: &'ll Value, name: &str, ) -> &'ll BasicBlock

Source§

fn append_sibling_block(&mut self, name: &str) -> &'ll BasicBlock

Source§

fn switch_to_block(&mut self, llbb: Self::BasicBlock)

Source§

fn ret_void(&mut self)

Source§

fn ret(&mut self, v: &'ll Value)

Source§

fn br(&mut self, dest: &'ll BasicBlock)

Source§

fn cond_br( &mut self, cond: &'ll Value, then_llbb: &'ll BasicBlock, else_llbb: &'ll BasicBlock, )

Source§

fn switch( &mut self, v: &'ll Value, else_llbb: &'ll BasicBlock, cases: impl ExactSizeIterator<Item = (u128, &'ll BasicBlock)>, )

Source§

fn invoke( &mut self, llty: &'ll Type, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, llfn: &'ll Value, args: &[&'ll Value], then: &'ll BasicBlock, catch: &'ll BasicBlock, funclet: Option<&Funclet<'ll>>, instance: Option<Instance<'tcx>>, ) -> &'ll Value

Source§

fn unreachable(&mut self)

Source§

fn add(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn fadd(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn sub(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn fsub(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn mul(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn fmul(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn udiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn exactudiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn sdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn exactsdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn fdiv(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn urem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn srem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn frem(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn shl(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Generate a left-shift. Both operands must have the same size. The right operand must be interpreted as unsigned and can be assumed to be less than the size of the left operand.
Source§

fn lshr(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Generate a logical right-shift. Both operands must have the same size. The right operand must be interpreted as unsigned and can be assumed to be less than the size of the left operand.
Source§

fn ashr(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Generate an arithmetic right-shift. Both operands must have the same size. The right operand must be interpreted as unsigned and can be assumed to be less than the size of the left operand.
Source§

fn and(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn or(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn xor(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value

Source§

fn neg(&mut self, x: &'ll Value) -> &'ll Value

Source§

fn fneg(&mut self, x: &'ll Value) -> &'ll Value

Source§

fn not(&mut self, x: &'ll Value) -> &'ll Value

Source§

fn unchecked_sadd(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn unchecked_uadd(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn unchecked_ssub(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn unchecked_usub(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn unchecked_smul(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn unchecked_umul(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fadd_fast(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fsub_fast(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fmul_fast(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fdiv_fast(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn frem_fast(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fadd_algebraic(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fsub_algebraic(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fmul_algebraic(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn fdiv_algebraic(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn frem_algebraic(&mut self, x: &'ll Value, y: &'ll Value) -> &'ll Value

Source§

fn checked_binop( &mut self, oop: OverflowOp, ty: Ty<'_>, lhs: Self::Value, rhs: Self::Value, ) -> (Self::Value, Self::Value)

Source§

fn from_immediate(&mut self, val: Self::Value) -> Self::Value

Source§

fn to_immediate_scalar( &mut self, val: Self::Value, scalar: Scalar, ) -> Self::Value

Source§

fn alloca(&mut self, size: Size, align: Align) -> &'ll Value

Source§

fn dynamic_alloca(&mut self, size: &'ll Value, align: Align) -> &'ll Value

Source§

fn load(&mut self, ty: &'ll Type, ptr: &'ll Value, align: Align) -> &'ll Value

Source§

fn volatile_load(&mut self, ty: &'ll Type, ptr: &'ll Value) -> &'ll Value

Source§

fn atomic_load( &mut self, ty: &'ll Type, ptr: &'ll Value, order: AtomicOrdering, size: Size, ) -> &'ll Value

Source§

fn load_operand( &mut self, place: PlaceRef<'tcx, &'ll Value>, ) -> OperandRef<'tcx, &'ll Value>

Source§

fn write_operand_repeatedly( &mut self, cg_elem: OperandRef<'tcx, &'ll Value>, count: u64, dest: PlaceRef<'tcx, &'ll Value>, )

Called for Rvalue::Repeat when the elem is neither a ZST nor optimizable using memset.
Source§

fn range_metadata(&mut self, load: &'ll Value, range: WrappingRange)

Source§

fn nonnull_metadata(&mut self, load: &'ll Value)

Source§

fn store( &mut self, val: &'ll Value, ptr: &'ll Value, align: Align, ) -> &'ll Value

Source§

fn store_with_flags( &mut self, val: &'ll Value, ptr: &'ll Value, align: Align, flags: MemFlags, ) -> &'ll Value

Source§

fn atomic_store( &mut self, val: &'ll Value, ptr: &'ll Value, order: AtomicOrdering, size: Size, )

Source§

fn gep( &mut self, ty: &'ll Type, ptr: &'ll Value, indices: &[&'ll Value], ) -> &'ll Value

Source§

fn inbounds_gep( &mut self, ty: &'ll Type, ptr: &'ll Value, indices: &[&'ll Value], ) -> &'ll Value

Source§

fn trunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn sext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fptoui_sat(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fptosi_sat(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fptoui(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fptosi(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn uitofp(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn sitofp(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fptrunc(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn fpext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn ptrtoint(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn inttoptr(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn bitcast(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn intcast( &mut self, val: &'ll Value, dest_ty: &'ll Type, is_signed: bool, ) -> &'ll Value

Source§

fn pointercast(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn icmp( &mut self, op: IntPredicate, lhs: &'ll Value, rhs: &'ll Value, ) -> &'ll Value

Source§

fn fcmp( &mut self, op: RealPredicate, lhs: &'ll Value, rhs: &'ll Value, ) -> &'ll Value

Source§

fn memcpy( &mut self, dst: &'ll Value, dst_align: Align, src: &'ll Value, src_align: Align, size: &'ll Value, flags: MemFlags, )

Source§

fn memmove( &mut self, dst: &'ll Value, dst_align: Align, src: &'ll Value, src_align: Align, size: &'ll Value, flags: MemFlags, )

Source§

fn memset( &mut self, ptr: &'ll Value, fill_byte: &'ll Value, size: &'ll Value, align: Align, flags: MemFlags, )

Source§

fn select( &mut self, cond: &'ll Value, then_val: &'ll Value, else_val: &'ll Value, ) -> &'ll Value

Source§

fn va_arg(&mut self, list: &'ll Value, ty: &'ll Type) -> &'ll Value

Source§

fn extract_element(&mut self, vec: &'ll Value, idx: &'ll Value) -> &'ll Value

Source§

fn vector_splat(&mut self, num_elts: usize, elt: &'ll Value) -> &'ll Value

Source§

fn extract_value(&mut self, agg_val: &'ll Value, idx: u64) -> &'ll Value

Source§

fn insert_value( &mut self, agg_val: &'ll Value, elt: &'ll Value, idx: u64, ) -> &'ll Value

Source§

fn set_personality_fn(&mut self, personality: &'ll Value)

Source§

fn cleanup_landing_pad( &mut self, pers_fn: &'ll Value, ) -> (&'ll Value, &'ll Value)

Source§

fn filter_landing_pad( &mut self, pers_fn: &'ll Value, ) -> (&'ll Value, &'ll Value)

Source§

fn resume(&mut self, exn0: &'ll Value, exn1: &'ll Value)

Source§

fn cleanup_pad( &mut self, parent: Option<&'ll Value>, args: &[&'ll Value], ) -> Funclet<'ll>

Source§

fn cleanup_ret( &mut self, funclet: &Funclet<'ll>, unwind: Option<&'ll BasicBlock>, )

Source§

fn catch_pad(&mut self, parent: &'ll Value, args: &[&'ll Value]) -> Funclet<'ll>

Source§

fn catch_switch( &mut self, parent: Option<&'ll Value>, unwind: Option<&'ll BasicBlock>, handlers: &[&'ll BasicBlock], ) -> &'ll Value

Source§

fn atomic_cmpxchg( &mut self, dst: &'ll Value, cmp: &'ll Value, src: &'ll Value, order: AtomicOrdering, failure_order: AtomicOrdering, weak: bool, ) -> (&'ll Value, &'ll Value)

Source§

fn atomic_rmw( &mut self, op: AtomicRmwBinOp, dst: &'ll Value, src: &'ll Value, order: AtomicOrdering, ) -> &'ll Value

Source§

fn atomic_fence(&mut self, order: AtomicOrdering, scope: SynchronizationScope)

Source§

fn set_invariant_load(&mut self, load: &'ll Value)

Source§

fn lifetime_start(&mut self, ptr: &'ll Value, size: Size)

Called for StorageLive
Source§

fn lifetime_end(&mut self, ptr: &'ll Value, size: Size)

Called for StorageDead
Source§

fn call( &mut self, llty: &'ll Type, fn_attrs: Option<&CodegenFnAttrs>, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, llfn: &'ll Value, args: &[&'ll Value], funclet: Option<&Funclet<'ll>>, instance: Option<Instance<'tcx>>, ) -> &'ll Value

Source§

fn zext(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value

Source§

fn apply_attrs_to_cleanup_callsite(&mut self, llret: &'ll Value)

Source§

fn cond_br_with_expect( &mut self, cond: Self::Value, then_llbb: Self::BasicBlock, else_llbb: Self::BasicBlock, expect: Option<bool>, )

Source§

fn to_immediate( &mut self, val: Self::Value, layout: TyAndLayout<'_, Ty<'_>>, ) -> Self::Value

Source§

fn load_from_place( &mut self, ty: Self::Type, place: PlaceValue<Self::Value>, ) -> Self::Value

Source§

fn store_to_place( &mut self, val: Self::Value, place: PlaceValue<Self::Value>, ) -> Self::Value

Source§

fn store_to_place_with_flags( &mut self, val: Self::Value, place: PlaceValue<Self::Value>, flags: MemFlags, ) -> Self::Value

Source§

fn ptradd(&mut self, ptr: Self::Value, offset: Self::Value) -> Self::Value

Source§

fn inbounds_ptradd( &mut self, ptr: Self::Value, offset: Self::Value, ) -> Self::Value

Source§

fn cast_float_to_int( &mut self, signed: bool, x: Self::Value, dest_ty: Self::Type, ) -> Self::Value

Source§

fn typed_place_copy( &mut self, dst: PlaceValue<Self::Value>, src: PlaceValue<Self::Value>, layout: TyAndLayout<'tcx, Ty<'tcx>>, )

Typed copy for non-overlapping places. Read more
Source§

fn typed_place_copy_with_flags( &mut self, dst: PlaceValue<Self::Value>, src: PlaceValue<Self::Value>, layout: TyAndLayout<'tcx, Ty<'tcx>>, flags: MemFlags, )

Source§

fn typed_place_swap( &mut self, left: PlaceValue<Self::Value>, right: PlaceValue<Self::Value>, layout: TyAndLayout<'tcx, Ty<'tcx>>, )

Typed swap for non-overlapping places. Read more
Source§

impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn init_coverage(&mut self, instance: Instance<'tcx>)

Performs any start-of-function codegen needed for coverage instrumentation. Read more
Source§

fn add_coverage(&mut self, instance: Instance<'tcx>, kind: &CoverageKind)

Handle the MIR coverage info in a backend-specific way. Read more
Source§

impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_>

Source§

fn dbg_var_addr( &mut self, dbg_var: &'ll DIVariable, dbg_loc: &'ll DILocation, variable_alloca: Self::Value, direct_offset: Size, indirect_offsets: &[Size], fragment: Option<Range<Size>>, )

Source§

fn set_dbg_loc(&mut self, dbg_loc: &'ll DILocation)

Source§

fn clear_dbg_loc(&mut self)

Source§

fn get_dbg_loc(&self) -> Option<&'ll DILocation>

Source§

fn insert_reference_to_gdb_debug_scripts_section_global(&mut self)

Source§

fn set_var_name(&mut self, value: &'ll Value, name: &str)

Source§

impl<'ll, 'tcx> Deref for Builder<'_, 'll, 'tcx>

Source§

type Target = CodegenCx<'ll, 'tcx>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for Builder<'_, '_, '_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'tcx> FnAbiOfHelpers<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn handle_fn_abi_err( &self, err: FnAbiError<'tcx>, span: Span, fn_abi_request: FnAbiRequest<'tcx>, ) -> !

Helper used for fn_abi_of_*, to adapt tcx.fn_abi_of_*(...) into a Self::FnAbiOfResult (which does not need to be a Result<...>). Read more
Source§

type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>

The &FnAbi-wrapping type (or &FnAbi itself), which will be returned from fn_abi_of_* (see also handle_fn_abi_err).
Source§

impl HasDataLayout for Builder<'_, '_, '_>

Source§

impl HasTargetSpec for Builder<'_, '_, '_>

Source§

impl<'tcx> HasTyCtxt<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn tcx(&self) -> TyCtxt<'tcx>

Source§

impl<'tcx> HasTypingEnv<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn typing_env(&self) -> TypingEnv<'tcx>

Source§

fn param_env(&self) -> ParamEnv<'tcx>

FIXME(#132279): This method should not be used as in the future everything should take a TypingEnv instead. Remove it as that point.
Source§

impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx>

Source§

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, ) -> Result<(), Instance<'tcx>>

Remember to add all intrinsics here, in compiler/rustc_hir_analysis/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. Returns Err if another instance should be called instead. This is used to invoke intrinsic default bodies in case an intrinsic is not implemented by the backend.
Source§

fn abort(&mut self)

Source§

fn assume(&mut self, val: Self::Value)

Source§

fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value

Source§

fn type_test( &mut self, pointer: Self::Value, typeid: Self::Metadata, ) -> Self::Value

Trait method used to test whether a given pointer is associated with a type identifier.
Source§

fn type_checked_load( &mut self, llvtable: &'ll Value, vtable_byte_offset: u64, typeid: &'ll Metadata, ) -> Self::Value

Trait method used to load a function while testing if it is associated with a type identifier.
Source§

fn va_start(&mut self, va_list: &'ll Value) -> &'ll Value

Trait method used to inject va_start on the “spoofed” VaListImpl in Rust defined C-variadic functions.
Source§

fn va_end(&mut self, va_list: &'ll Value) -> &'ll Value

Trait method used to inject va_end on the “spoofed” VaListImpl before Rust defined C-variadic functions return.
Source§

impl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, '_, 'tcx>

Source§

fn handle_layout_err( &self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>, ) -> !

Helper used for layout_of, to adapt tcx.layout_of(...) into a Self::LayoutOfResult (which does not need to be a Result<...>). Read more
Source§

type LayoutOfResult = TyAndLayout<'tcx, Ty<'tcx>>

The TyAndLayout-wrapping type (or TyAndLayout itself), which will be returned from layout_of (see also handle_layout_err).
Source§

fn layout_tcx_at_span(&self) -> Span

Span to use for tcx.at(span), from layout_of.
Source§

impl<'ll> StaticBuilderMethods for Builder<'_, 'll, '_>

Source§

fn get_static(&mut self, def_id: DefId) -> &'ll Value

Auto Trait Implementations§

§

impl<'a, 'll, 'tcx> !DynSend for Builder<'a, 'll, 'tcx>

§

impl<'a, 'll, 'tcx> !DynSync for Builder<'a, 'll, 'tcx>

§

impl<'a, 'll, 'tcx> Freeze for Builder<'a, 'll, 'tcx>

§

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>

§

impl<'a, 'll, 'tcx> !UnwindSafe for Builder<'a, 'll, 'tcx>

Blanket Implementations§

Source§

impl<T> Aligned for T

Source§

const ALIGN: Alignment = _

Alignment of Self.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, R> CollectAndApply<T, R> for T

Source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

Source§

type Output = R

Source§

impl<T> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<'tcx, C> FnAbiOf<'tcx> for C
where C: FnAbiOfHelpers<'tcx>,

Source§

fn fn_abi_of_fn_ptr( &self, sig: Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>, extra_args: &'tcx RawList<(), Ty<'tcx>>, ) -> Self::FnAbiOfResult

Compute a FnAbi suitable for indirect calls, i.e. to fn pointers. Read more
Source§

fn fn_abi_of_instance( &self, instance: Instance<'tcx>, extra_args: &'tcx RawList<(), Ty<'tcx>>, ) -> Self::FnAbiOfResult

Compute a FnAbi suitable for declaring/defining an fn instance, and for direct calls to an fn. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P> IntoQueryParam<P> for P

Source§

impl<'tcx, C> LayoutOf<'tcx> for C
where C: LayoutOfHelpers<'tcx>,

Source§

fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult

Computes the layout of a type. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.
Source§

fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult

Computes the layout of a type, at span. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.
Source§

impl<T> MaybeResult<T> for T

Source§

type Error = !

Source§

fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

Source§

fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PointerArithmetic for T
where T: HasDataLayout,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

Source§

fn upcast(self, interner: I) -> U

Source§

impl<I, T> UpcastFrom<I, T> for T

Source§

fn upcast_from(from: T, _tcx: I) -> T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

Source§

default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Layout§

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