Skip to main content

Module internal_function_used_once

Module internal_function_used_once 

Source

Structsยง

RefInfo ๐Ÿ”’
The references resolving to one function: how many, whether the function references itself, and which function the first reference came from, None when it came from outside any function body (a variable initializer). Self-references are recorded apart rather than counted.
ReferenceCounter ๐Ÿ”’

Staticsยง

INTERNAL_FUNCTION_USED_ONCE

Functionsยง

count_function_references ๐Ÿ”’
Counts, for every function of the unit, the expressions that resolve to it, calls and references used as values alike. type_of_expr gives the single declaration the type checker selected, so overload selection, the qualified and using for forms and import aliases are all attributed to the right function.
only_referenced_within_cycle ๐Ÿ”’
Whether a functionโ€™s single reference only enters it through a reference cycle: the chain of single-reference sources loops back on itself, so there is no non-recursive caller to inline into (mutually recursive helpers with no external caller).
operator_bound_functions ๐Ÿ”’
Collects every function the unit binds as a user-defined operator, through a using {f as +} for T entry of a file-level or contract-level directive. The HIR already resolved those entries to function ids.