pub struct FunctionRef<'str, 'ctx, R = ModuleView<'ctx, 'str>> {
pub id: FunctionId,
/* private fields */
}Fields§
§id: FunctionIdImplementations§
Source§impl<'s, 'ctx: 's, 'str: 'ctx, R> FunctionRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
impl<'s, 'ctx: 's, 'str: 'ctx, R> FunctionRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
Sourcepub fn is_external(&'s self) -> bool
pub fn is_external(&'s self) -> bool
Whether the function interface marks this function external.
Sourcepub fn import_ordinal(&'s self) -> Option<u16>
pub fn import_ordinal(&'s self) -> Option<u16>
The ordinal this import was brought in at, for a PE import resolved from
an ordinal-only entry. None for named imports and local functions.
Sourcepub fn signature(&'s self) -> Option<&'ctx FunctionSignature>
pub fn signature(&'s self) -> Option<&'ctx FunctionSignature>
A reference to the function interface’s signature, if any.
Sourcepub fn users_of(&'s self, value: ValueId) -> Vec<InstructionId>
pub fn users_of(&'s self, value: ValueId) -> Vec<InstructionId>
This function’s instructions that use value as an operand. See
FunctionBody::users_of; this is the function-scoped read every pass wants
for an SSA value (all its users are intra-function).
Sourcepub fn local_users_of(&'s self, value: ValueId) -> &'ctx [LocalInsnId]
pub fn local_users_of(&'s self, value: ValueId) -> &'ctx [LocalInsnId]
This function’s users of value in their stored, body-local form.
Borrowed rather than built: a pass that reads the list once per
instruction should not allocate one per instruction to do it. Qualify
with this function’s id when a whole InstructionId is needed.
Sourcepub fn has_users(&'s self, value: ValueId) -> bool
pub fn has_users(&'s self, value: ValueId) -> bool
Whether this function uses value at all, without building the user
list to ask. See FunctionBody::has_users.
Sourcepub fn user_map_entries(
&'s self,
) -> impl Iterator<Item = (ValueId, Vec<InstructionId>)> + 's
pub fn user_map_entries( &'s self, ) -> impl Iterator<Item = (ValueId, Vec<InstructionId>)> + 's
Iterate this function’s recorded (value, users) reverse-use entries
(see FunctionBody::user_map_entries).
Sourcepub fn local_named(&'s self, name: &str) -> Option<ValueId>
pub fn local_named(&'s self, name: &str) -> Option<ValueId>
Resolve a block/instruction/param/Temp name within this function’s local name
table (see FunctionBody::names). None if this function has no such name.
Sourcepub fn param_attr(&'s self, index: usize) -> Option<ParamAttrs>
pub fn param_attr(&'s self, index: usize) -> Option<ParamAttrs>
The inferred pointer attributes for positional argument index, or None
when this function has no analyzed attributes (treat conservatively: the
argument escapes and may be written through). See
FunctionSignature::param_attrs.
Sourcepub fn param_attrs(&'s self) -> Option<&'ctx [ParamAttrs]>
pub fn param_attrs(&'s self) -> Option<&'ctx [ParamAttrs]>
The full per-parameter attribute vector, if analyzed.
Sourcepub fn written_spaces(&'s self) -> Option<&'ctx [SpaceId]>
pub fn written_spaces(&'s self) -> Option<&'ctx [SpaceId]>
The non-register memory spaces this function may (transitively) write, as
set by analysis. Some(spaces) is exact (a space not listed is never
written); None conflates “unstamped” and “stamped unbounded” — both are
treated conservatively (may write any space) by consumers. For the
tri-state distinction use written_spaces_state.
See FunctionSignature::written_spaces.
Sourcepub fn written_spaces_state(&'s self) -> WrittenSpaces<'ctx>
pub fn written_spaces_state(&'s self) -> WrittenSpaces<'ctx>
The tri-state written_spaces verdict, distinguishing a never-stamped
fresh mint (WrittenSpaces::Unstamped) from a deliberately recorded
⊤ (WrittenSpaces::Unbounded). See FunctionSignature::written_spaces.
Sourcepub fn is_reg_materialized(&'s self) -> bool
pub fn is_reg_materialized(&'s self) -> bool
Whether this function’s register interface has been materialized (argpromote
v2) — i.e. its effects are
RegisterChannelState::Materialized. Legacy name for the register-channel
“functionalized” predicate.
Sourcepub fn effects(&'s self) -> &'ctx FunctionEffects
pub fn effects(&'s self) -> &'ctx FunctionEffects
This function’s call-graph-closed register FunctionEffects summary.
RegisterChannelState::Unsolved until the effect-analysis pass runs (and
after a snapshot load). See FunctionInterface::effects.
Sourcepub fn is_pure(&'s self) -> bool
pub fn is_pure(&'s self) -> bool
Whether argpromote has functionalized every side-effect channel of this
function — it is a deterministic pure function of its by-value params,
touching no caller-visible memory or registers. Strictly stronger than
is_reg_materialized. See FunctionSignature::is_pure.
Sourcepub fn is_lambda(&'s self) -> bool
pub fn is_lambda(&'s self) -> bool
Whether this is a pure value-level lambda rather than a machine function.
pub fn kind(&'s self) -> FunctionKind
Sourcepub fn extern_interface(&'s self) -> Option<&'ctx ExternInterface>
pub fn extern_interface(&'s self) -> Option<&'ctx ExternInterface>
The C-prototype-derived external call interface, if external_sigs
planned one. Read by argpromote_external to rewrite call sites. See
FunctionSignature::extern_interface.
Sourcepub fn argmem(&'s self) -> Option<&'ctx ExternArgmem>
pub fn argmem(&'s self) -> Option<&'ctx ExternArgmem>
The C-prototype-derived argmem summary for a prototyped external, or None
when this function is not a prototyped external. See
FunctionSignature::argmem.
Sourcepub fn input_arg_name(&'s self, index: usize) -> Option<String>
pub fn input_arg_name(&'s self, index: usize) -> Option<String>
The display name for the call-site argument bound to input index: the
name of the callee’s root block param at index, or — for a bodyless
external with no root block — the C-prototype argument name recorded in
its extern_interface. None when there is no
input at index or it is unnamed.
Sourcepub fn reads_unbounded_stack(&'s self) -> bool
pub fn reads_unbounded_stack(&'s self) -> bool
Whether this function performs an unresolved/dynamic stack read (or
forwards a stack pointer into one). See
FunctionSignature::reads_unbounded_stack.
Sourcepub fn frame_escapes_to_unbounded(&'s self) -> bool
pub fn frame_escapes_to_unbounded(&'s self) -> bool
Whether this function hands a pointer into its own frame to a callee that
may read it unboundedly. See
FunctionSignature::frame_escapes_to_unbounded.
Sourcepub fn instruction_addrs(&'s self) -> impl Iterator<Item = u64> + 'ctx
pub fn instruction_addrs(&'s self) -> impl Iterator<Item = u64> + 'ctx
The addresses of every machine instruction lifted into this function, in
ascending order. Unlike blocks, this is stable across
optimization, so it drives the raw disassembly view.
Sourcepub fn has_map(&'s self) -> bool
pub fn has_map(&'s self) -> bool
Whether this function contains at least one Map
instruction — a lane-wise array map operation. Surfaced as an advanced
filter in the function list.
Sourcepub fn root(&'s self) -> Option<BlockRef<'str, 'ctx, R>>
pub fn root(&'s self) -> Option<BlockRef<'str, 'ctx, R>>
The root block of this function, if it exists.
Sourcepub fn blocks(&'s self) -> impl Iterator<Item = BlockRef<'str, 'ctx, R>> + 's
pub fn blocks(&'s self) -> impl Iterator<Item = BlockRef<'str, 'ctx, R>> + 's
An iterator over the (live) blocks belonging to this function.
Sourcepub fn block_ids(&'s self) -> Vec<BlockId>
pub fn block_ids(&'s self) -> Vec<BlockId>
The composite ids of this function’s live blocks, in roster order.
Sourcepub fn instruction_ids(&'s self) -> Vec<InstructionId>
pub fn instruction_ids(&'s self) -> Vec<InstructionId>
The composite IDs of this function’s live instructions, in dense physical
order — including any currently detached (parent == None).
Source§impl<'str, 'ctx, R> FunctionRef<'str, 'ctx, R>
impl<'str, 'ctx, R> FunctionRef<'str, 'ctx, R>
Source§impl<'str, 'ctx> FunctionRef<'str, 'ctx>
impl<'str, 'ctx> FunctionRef<'str, 'ctx>
pub fn from_id(ctx: &'ctx Context<'str>, id: FunctionId) -> Self
Trait Implementations§
Source§impl<'str: 'ctx, 'ctx, R> Cfg for FunctionRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
impl<'str: 'ctx, 'ctx, R> Cfg for FunctionRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
type NodeId = BlockId
Source§type Hasher = FxBuildHasher
type Hasher = FxBuildHasher
FxBuildHasher) keeps successors iteration —
and thus the derived dominator structures — deterministic across runs,
whereas the std default (RandomState) reseeds per process.Source§impl<'str, 'ctx, R: Clone> Clone for FunctionRef<'str, 'ctx, R>
impl<'str, 'ctx, R: Clone> Clone for FunctionRef<'str, 'ctx, R>
Source§fn clone(&self) -> FunctionRef<'str, 'ctx, R>
fn clone(&self) -> FunctionRef<'str, 'ctx, R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more