pub struct CfgFeature {
pub hash: FeatureHash,
pub skeleton_hash: FeatureHash,
pub op_count: u32,
pub skeleton_ops: u32,
pub max_loop_depth: u32,
pub branch_count: u32,
}Expand description
The approximate control-flow profile of one unit.
Built by one pre-order walk that emits a control-op byte sequence: loop,
branch and match-arm enters and exits, a match enter carrying its arm
count, and single ops for try, return, break, continue and calls.
See the module documentation for why this is a syntactic approximation.
Fields§
§hash: FeatureHashHash over the control-op sequence.
skeleton_hash: FeatureHashHash over the same sequence with calls left out: the unit’s branching and looping shape alone.
A call is an operation the unit performs, not a fork in the path
through it, and codehelion already describes calls separately in
ApiCallFeature. Keeping them out of one of the two hashes gives a
key that survives an edit which only adds calls, which is what makes it
usable as a candidate-extraction index.
op_count: u32Number of control ops emitted.
skeleton_ops: u32Number of ops behind Self::skeleton_hash: op_count less the calls.
max_loop_depth: u32Deepest loop nesting in the unit subtree; 0 without loops.
branch_count: u32Number of two-way conditionals in the unit subtree.
Trait Implementations§
Source§impl Clone for CfgFeature
impl Clone for CfgFeature
Source§fn clone(&self) -> CfgFeature
fn clone(&self) -> CfgFeature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CfgFeature
impl Debug for CfgFeature
impl Eq for CfgFeature
Source§impl PartialEq for CfgFeature
impl PartialEq for CfgFeature
impl StructuralPartialEq for CfgFeature
Auto Trait Implementations§
impl Freeze for CfgFeature
impl RefUnwindSafe for CfgFeature
impl Send for CfgFeature
impl Sync for CfgFeature
impl Unpin for CfgFeature
impl UnsafeUnpin for CfgFeature
impl UnwindSafe for CfgFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.