Expand description
Shared drop-glue utilities: reachability checks and synthesized symbol names.
Both the drop-glue synthesizer (gruel-compiler) and the LLVM codegen
(gruel-codegen-llvm) need to agree on:
- whether a type requires a destructor call, and
- the exact name of the synthesized
__gruel_drop_*symbol for that type.
Putting these here avoids duplicating the logic and keeps the two sites in sync automatically — if the names ever need to change, there is one place to edit.
Functions§
- drop_
fn_ name - Return the name of the synthesized
__gruel_drop_*function forty, orNoneif the type is trivially droppable or is a built-in with a runtime-provided destructor (e.g.String→__gruel_drop_Stringlives ingruel-runtimeand is called via a dedicated code path, not through a synthesized wrapper). - type_
name_ component - A stable, human-readable name component for
ty, used inside drop-glue symbol names (e.g. theString_3in__gruel_drop_array_String_3). - type_
needs_ drop - Return
trueiftyrequires a drop call when it goes out of scope.