rustc_codegen_ssa::base - Rust (original) (raw)
Decide allocator kind to codegen. If Some(_)
this will be the same astcx.allocator_kind
, but it may be None
in more cases (e.g. if using allocator definitions from a dylib dependency).
build_shift_expr_rhs đź”’
Returns rhs
sufficiently masked, truncated, and/or extended so that it can be used to shiftlhs
: it has the same size as lhs
, and the value, when interpreted unsigned (no matter its type), will not exceed the size of lhs
.
cast_to_dyn_star đź”’
Coerces src
to dst_ty
which is guaranteed to be a dyn*
type.
codegen_instance đź”’
coerce_unsized_into đź”’
Coerces src
, which is a reference to a value of type src_ty
, to a value of type dst_ty
, and stores the result in dst
.
collect_debugger_visualizers_transitive
This function returns all of the debugger visualizers specified for the current crate as well as all upstream crates transitively that match thevisualizer_type
specified.
get_argc_argv đź”’
Obtain the argc
and argv
values to pass to the rust start function (i.e., the “start” lang item).
is_call_from_compiler_builtins_to_upstream_monomorphization
Returns whether a call from the current crate to the Instance would produce a call from compiler_builtins
to a symbol the linker must resolve.
Creates the main
function which will initialize the rust runtime and call users main function.
provide đź”’
unsize_ptr đź”’
Coerces src
to dst_ty
. src_ty
must be a pointer.
unsized_info đź”’
Retrieves the information we are losing (making dynamic) in an unsizing adjustment.
Codegen takes advantage of the additional assumption, where if the principal trait def id of what’s being casted doesn’t change, then we don’t need to adjust the vtable at all. This corresponds to the fact that dyn Tr<A>: Unsize<dyn Tr<B>>
requires that A = B
; we don’t allow upcasting objects between the same trait with different args. If we, for some reason, were to relax the Unsize
trait, it could become unsound, so let’s validate here that the trait refs are subtypes.
Returns true
if this session’s target will use SEH-based unwinding.
wants_new_eh_instructions đź”’
Returns true
if this session’s target requires the new exception handling LLVM IR instructions (catchpad / cleanuppad / … instead of landingpad)