diff options
author | johnvg | 2016-05-18 12:03:36 +0000 |
---|---|---|
committer | johnvg | 2016-05-18 12:03:36 +0000 |
commit | 2f964ec48555166b2437a7afd9ba45bff1bd2b5c (patch) | |
tree | 9d836ffeeeff80f2517e5f2dab9c41c418f2b621 /backendC/CleanCompilerSources | |
parent | remove some unnecessary copying on the stack for root record updates (diff) |
remove unused functions
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2708 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC/CleanCompilerSources')
-rw-r--r-- | backendC/CleanCompilerSources/tcsupport.h | 4 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/tcsupport_2.c | 34 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/typeconv_2.c | 184 |
3 files changed, 0 insertions, 222 deletions
diff --git a/backendC/CleanCompilerSources/tcsupport.h b/backendC/CleanCompilerSources/tcsupport.h index 111c6e9..a4f3fc5 100644 --- a/backendC/CleanCompilerSources/tcsupport.h +++ b/backendC/CleanCompilerSources/tcsupport.h @@ -6,8 +6,4 @@ Author: Sjaak Smetsers */ -extern BITVECT DetermineUniPropOfTypeCons (SymbDef typecons); - -extern BITVECT DetermineConsVarsOfTypeCons (SymbDef typecons, ConsVarList * cons_vars); - extern void PrintNodeSymbol (Node node, int arg_nr, File file); diff --git a/backendC/CleanCompilerSources/tcsupport_2.c b/backendC/CleanCompilerSources/tcsupport_2.c index 96d3e21..ae57ffb 100644 --- a/backendC/CleanCompilerSources/tcsupport_2.c +++ b/backendC/CleanCompilerSources/tcsupport_2.c @@ -22,40 +22,6 @@ #include "comparser.h" #include "buildtree.h" -BITVECT DetermineUniPropOfTypeCons (SymbDef typecons) -{ - if (typecons -> sdef_kind == TYPE || typecons -> sdef_kind == RECORDTYPE) - return (typecons -> sdef_type) ? typecons -> sdef_type -> type_uniprop : ALLBITSSET; - else - return (typecons -> sdef_kind == TYPESYN) ? typecons -> sdef_syn_type -> syntype_uniprop : ALLBITSSET; - -} /* DetermineUniPropOfTypeCons */ - -BITVECT DetermineConsVarsOfTypeCons (SymbDef typecons, ConsVarList * cons_vars) -{ - if (typecons -> sdef_kind == TYPE || typecons -> sdef_kind == RECORDTYPE) - { if (typecons -> sdef_type) - { * cons_vars = NULL; - return typecons -> sdef_type -> type_consvars; - } - else - { * cons_vars = NULL; - return ALLBITSCLEAR; - } - } - else if (typecons -> sdef_kind == TYPESYN) - { * cons_vars = NULL; - return typecons -> sdef_syn_type -> syn_consvars; - } - else - { * cons_vars = NULL; - return ALLBITSCLEAR; - } - -} /* DetermineConsVarsOfTypeCons */ - -#define SubstitutedType(typeargs) ((typeargs)[-1]) - void PrintNodeSymbol (Node node, int arg_nr, File file) { Symbol rootsymb; diff --git a/backendC/CleanCompilerSources/typeconv_2.c b/backendC/CleanCompilerSources/typeconv_2.c index de8859b..38d0bcb 100644 --- a/backendC/CleanCompilerSources/typeconv_2.c +++ b/backendC/CleanCompilerSources/typeconv_2.c @@ -35,190 +35,6 @@ typedef static ARC_Info CurrentARC_Info; -static ARC_Info NewARC_Info (void) -{ - ARC_Info new = CompAllocType (struct attr_ref_count_info); - new -> arci_used = ALLBITSCLEAR; - new -> arci_multiply_used = ALLBITSCLEAR; - new -> arci_implicitly_attributed = ALLBITSCLEAR; - new -> arci_next = NULL; - return new; - -} /* NewARC_Info */ - -static void ClearARC_Info (void) -{ - ARC_Info next; - for (next = CurrentARC_Info; next; next = next -> arci_next) - { next -> arci_used = ALLBITSCLEAR; - next -> arci_multiply_used = ALLBITSCLEAR; - next -> arci_implicitly_attributed = ALLBITSCLEAR; - } - -} /* ClearARC_Info */ - -static void UpdateRefCountInfo (int attr_var, Bool used_implicitly) -{ - ARC_Info attrinfo = CurrentARC_Info; - while (attr_var >= 32) - { attr_var -= 32; - if (attrinfo -> arci_next == NULL) - attrinfo -> arci_next = NewARC_Info (); - attrinfo = attrinfo -> arci_next; - } - if (used_implicitly) - attrinfo -> arci_implicitly_attributed |= BIT (attr_var); - if (BITTEST (attrinfo -> arci_used, attr_var)) - attrinfo -> arci_multiply_used |= BIT (attr_var); - else - attrinfo -> arci_used |= BIT (attr_var); - -} /* UpdateRefCountInfo */ - -static Bool DetermineRefCountOfAttributeVarsInTypeVar (TypeNode type_var) -{ - if (type_var -> type_node_attribute >= FirstUniVarNumber) - { if (type_var -> type_node_tv != NULL) - { if (! TestMark (type_var -> type_node_tv, tv_mark, TV_UNIQUE_VARIABLE_PRINT_MASK)) - { SetMark (type_var -> type_node_tv, tv_mark, TV_UNIQUE_VARIABLE_PRINT_MASK); - UpdateRefCountInfo (type_var -> type_node_attribute - FirstUniVarNumber, False); - } - } - return True; - } - else - return False; - -} /* DetermineRefCountOfAttributeVarsInTypeVar */ - -static BITVECT CombineTypeArguments (ConsVarList cons_var, int arity1, BITVECT args1, int arity2, BITVECT args2) -{ - BITVECT combined_args = ALLBITSCLEAR; - int cons_var_arity = cons_var -> cvl_arity; - - int i, j; - - for (j = 0; j < cons_var_arity; j++) - { BITVECT cons_var_prop = cons_var -> cvl_argclass [j].tac_uniprop; - - for (i = 0; i < arity1; i++) - { if (BITTEST (cons_var_prop, i) && BITTEST (args1, i)) - combined_args |= BIT (j); - } - - for (i = 0; i < arity2; i++) - { if (BITTEST (cons_var_prop, i+arity1) && BITTEST (args2, i)) - combined_args |= BIT (j); - } - } - - return combined_args; - -} /* CombineTypeArguments */ - -static Bool DetermineRefCountOfAttributeVarsInNode (TypeNode type_node); - -static Bool DetermineRefCountOfAttributeVarsInTypeConsNode (TypeNode type_node, Symbol type_symb, - int nr_of_extra_args, BITVECT extra_prop_args) -{ - TypeArgs type_args; - int arg_nr; - - Bool contains_propating_univars = False; - - ConsVarList cons_vars; - BITVECT uniprop, cons_var_vect, propagating_args = ALLBITSCLEAR; - - - if (type_symb -> symb_kind == definition) - { cons_var_vect = DetermineConsVarsOfTypeCons (type_symb -> symb_def, & cons_vars); - uniprop = DetermineUniPropOfTypeCons (type_symb -> symb_def); - } - else - { cons_var_vect = ALLBITSCLEAR; - cons_vars = NULL; - if (type_symb -> symb_kind == fun_type) - uniprop = ALLBITSCLEAR; - else if (type_symb -> symb_kind == apply_symb) - uniprop = BIT (0); - else - uniprop = ALLBITSSET; - } - - for (type_args = type_node -> type_node_arguments, arg_nr=0; type_args; - type_args = type_args -> type_arg_next, arg_nr++) - { if (! BITTEST (cons_var_vect, arg_nr)) - { if (DetermineRefCountOfAttributeVarsInNode (type_args -> type_arg_node)) - { propagating_args |= BIT(arg_nr); - if (BITTEST (uniprop, arg_nr)) - contains_propating_univars = True; - } - } - } - - for (type_args = type_node -> type_node_arguments, arg_nr=0; cons_vars; cons_vars = cons_vars -> cvl_next) - { for (; type_args != NULL && arg_nr < cons_vars -> cvl_number; arg_nr++, type_args = type_args -> type_arg_next) - ; - if (type_args != NULL) - { TypeNode cons_node = type_args -> type_arg_node; - - if (cons_node -> type_node_is_var) - { if (DetermineRefCountOfAttributeVarsInTypeVar (cons_node) && BITTEST (uniprop, arg_nr)) - contains_propating_univars = True; - } - else - { BITVECT comb_args_prop = CombineTypeArguments (cons_vars, type_node -> type_node_arity, propagating_args, - nr_of_extra_args, extra_prop_args); - - if (DetermineRefCountOfAttributeVarsInTypeConsNode (cons_node, cons_node -> type_node_symbol, - cons_vars -> cvl_arity, comb_args_prop) && BITTEST (uniprop, arg_nr)) - contains_propating_univars = True; - } - } - } - - if (! contains_propating_univars) - { extra_prop_args &= uniprop >> type_node -> type_node_arity; - - for (arg_nr = 0; arg_nr < nr_of_extra_args; arg_nr ++) - { if (BITTEST (extra_prop_args, arg_nr)) - { contains_propating_univars = True; - break; - } - } - } - - if (type_node -> type_node_attribute >= FirstUniVarNumber) - { UpdateRefCountInfo (type_node -> type_node_attribute - FirstUniVarNumber, contains_propating_univars); - return True; - } - else - return contains_propating_univars; - -} /* DetermineRefCountOfAttributeVarsInTypeConsNode */ - -static Bool DetermineRefCountOfAttributeVarsInNode (TypeNode type_node) -{ - if (type_node -> type_node_is_var) - return DetermineRefCountOfAttributeVarsInTypeVar (type_node); - else - { Symbol typesymb = type_node -> type_node_symbol; - - if (typesymb -> symb_kind < Nr_Of_Basic_Types) - { if (type_node -> type_node_attribute >= FirstUniVarNumber) - { UpdateRefCountInfo (type_node -> type_node_attribute - FirstUniVarNumber, False); - return True; - } - else - return False; - } - else - return DetermineRefCountOfAttributeVarsInTypeConsNode (type_node, typesymb, 0, ALLBITSCLEAR); - } - - -} /* DetermineRefCountOfAttributeVarsInNode */ - static char *TypeConv = "typeconv"; static unsigned RetrieveRefCountInfo (int attr_var, Bool *used_implicitly) |