Struct rustc_codegen_llvm::builder::Builder [−][src]
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
pub fn insert_element(
&mut self,
vec: &'ll Value,
elt: &'ll Value,
idx: &'ll Value
) -> &'ll Valuepub fn shuffle_vector(
&mut self,
v1: &'ll Value,
v2: &'ll Value,
mask: &'ll Value
) -> &'ll Valuefn check_call<'b>(
&mut self,
typ: &str,
llfn: &'ll Value,
args: &'b [&'ll Value]
) -> Cow<'b, [&'ll Value]>Methods from Deref<Target = CodegenCx<'ll, 'tcx>>
Generates a new symbol name with the given prefix. This symbol name must
only be used for definitions with internal or private linkage.
Looks up debug source information about a BytePos.
Declare a global value.
If there’s a value with the same name already declared, the function will return its Value instead.
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.
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.
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).
Declare a private global
Use this function when you intend to define a global without a name.
Gets declared value by name.
Gets defined or externally defined (AvailableExternally linkage) value by name.
pub(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
) -> boolWhether a definition or declaration can be assumed to be local to a group of libraries that form a single DSO or executable.
x Creates an integer type with the given number of bits, e.g., i24
Return a LLVM type that has at most the required alignment, and exactly the required size, as a best-effort padding array.
Trait Implementations
fn codegen_llvm_inline_asm(
&mut self,
ia: &LlvmInlineAsmInner,
outputs: Vec<PlaceRef<'tcx, &'ll Value>>,
inputs: Vec<&'ll Value>,
span: Span
) -> bool
fn codegen_llvm_inline_asm(
&mut self,
ia: &LlvmInlineAsmInner,
outputs: Vec<PlaceRef<'tcx, &'ll Value>>,
inputs: Vec<&'ll Value>,
span: Span
) -> boolTake an inline assembly expression and splat it out via LLVM
fn codegen_inline_asm(
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[InlineAsmOperandRef<'tcx, Self>],
options: InlineAsmOptions,
line_spans: &[Span]
)
fn codegen_inline_asm(
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[InlineAsmOperandRef<'tcx, Self>],
options: InlineAsmOptions,
line_spans: &[Span]
)Take an inline assembly expression and splat it out via LLVM
fn append_block(
cx: &'a CodegenCx<'ll, 'tcx>,
llfn: &'ll Value,
name: &str
) -> &'ll BasicBlockfn 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,
llfn: &'ll Value,
args: &[&'ll Value],
then: &'ll BasicBlock,
catch: &'ll BasicBlock,
funclet: Option<&Funclet<'ll>>
) -> &'ll Valuefn checked_binop(
&mut self,
oop: OverflowOp,
ty: Ty<'_>,
lhs: Self::Value,
rhs: Self::Value
) -> (Self::Value, Self::Value)fn 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>
) -> SelfCalled for Rvalue::Repeat when the elem is neither a ZST nor optimizable using memset.
fn store_with_flags(
&mut self,
val: &'ll Value,
ptr: &'ll Value,
align: Align,
flags: MemFlags
) -> &'ll Valuefn atomic_store(
&mut self,
val: &'ll Value,
ptr: &'ll Value,
order: AtomicOrdering,
size: Size
)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 landing_pad(
&mut self,
ty: &'ll Type,
pers_fn: &'ll Value,
num_clauses: usize
) -> &'ll Valuefn cleanup_ret(
&mut self,
funclet: &Funclet<'ll>,
unwind: Option<&'ll BasicBlock>
) -> &'ll Valuefn catch_switch(
&mut self,
parent: Option<&'ll Value>,
unwind: Option<&'ll BasicBlock>,
num_handlers: usize
) -> &'ll Valuefn atomic_cmpxchg(
&mut self,
dst: &'ll Value,
cmp: &'ll Value,
src: &'ll Value,
order: AtomicOrdering,
failure_order: AtomicOrdering,
weak: bool
) -> &'ll Valuefn atomic_rmw(
&mut self,
op: AtomicRmwBinOp,
dst: &'ll Value,
src: &'ll Value,
order: AtomicOrdering
) -> &'ll ValueCalled for StorageLive
Called for StorageDead
fn instrprof_increment(
&mut self,
fn_name: &'ll Value,
hash: &'ll Value,
num_counters: &'ll Value,
index: &'ll Value
)fn call(
&mut self,
llfn: &'ll Value,
args: &[&'ll Value],
funclet: Option<&Funclet<'ll>>
) -> &'ll Valuefn to_immediate(
&mut self,
val: Self::Value,
layout: TyAndLayout<'_, &TyS<'_>>
) -> Self::Valuefn 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
) -> boolReturns true if the function source hash was added to the coverage map (even if it had
already been added, for this instance). Returns false only if -Z instrument-coverage is
not enabled (a coverage map is not being generated). Read more
fn 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
) -> boolReturns true if the counter was added to the coverage map; false if -Z instrument-coverage
is not enabled (a coverage map is not being generated). Read more
fn 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>
) -> boolReturns true if the expression was added to the coverage map; false if
-Z instrument-coverage is not enabled (a coverage map is not being generated). Read more
Returns true if the region was added to the coverage map; false if -Z instrument-coverage
is not enabled (a coverage map is not being generated). Read more
fn dbg_var_addr(
&mut self,
dbg_var: &'ll DIVariable,
dbg_loc: &'ll DILocation,
variable_alloca: Self::Value,
direct_offset: Size,
indirect_offsets: &[Size]
)Remember to add all intrinsics here, in 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 more
Emits a forced side effect. Read more
Trait method used to inject va_start on the “spoofed” VaListImpl in
Rust defined C-variadic functions. Read more
type TyAndLayout = TyAndLayout<'tcx>Auto Trait Implementations
impl<'a, 'll, 'tcx> !RefUnwindSafe for Builder<'a, 'll, 'tcx>impl<'a, 'll, 'tcx> !UnwindSafe for Builder<'a, 'll, 'tcx>Blanket Implementations
Layout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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