-
-/*-----------------------------------------.
-| Set the DESTRUCTOR associated with SYM. |
-`-----------------------------------------*/
-
-void
-symbol_destructor_set (symbol *sym, code_props destructor)
-{
- if (code_props_code_get (sym->destructor))
- symbol_redeclaration (sym, "%destructor",
- code_props_location_get (sym->destructor),
- code_props_location_get (destructor));
- sym->destructor = destructor;
-}
-
-/*------------------------------------------.
-| Set the DESTRUCTOR associated with TYPE. |
-`------------------------------------------*/
-
-void
-semantic_type_destructor_set (semantic_type *type, code_props destructor)
-{
- if (code_props_code_get (type->destructor))
- semantic_type_redeclaration (type, "%destructor",
- code_props_location_get (type->destructor),
- code_props_location_get (destructor));
- type->destructor = destructor;
-}
-
-/*---------------------------------------.
-| Get the computed %destructor for SYM. |
-`---------------------------------------*/
-
-code_props
-symbol_destructor_get (symbol *sym)
-{
- /* Per-symbol %destructor. */
- if (code_props_code_get (sym->destructor))
- return sym->destructor;
-
- /* Per-type %destructor. */
- if (sym->type_name)
- {
- code_props destructor = semantic_type_get (sym->type_name)->destructor;
- if (code_props_code_get (destructor))
- return destructor;
- }
-
- /* Apply default %destructor's only to user-defined symbols. */
- if (sym->tag[0] == '$' || sym == errtoken)
- return code_props_none;
-
- if (sym->type_name)
- return default_tagged_destructor;
- return default_tagless_destructor;
-}
-
-/*--------------------------------------.
-| Set the PRINTER associated with SYM. |
-`--------------------------------------*/