From fc9aa9b69977cb1c10cbf729648f2af0ee8a07ec Mon Sep 17 00:00:00 2001 From: johnvg Date: Wed, 8 Aug 2012 12:20:49 +0000 Subject: build the whole st_attr_vars list in function generateFunction, instead of building it lazily git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2142 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/trans.icl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/trans.icl b/frontend/trans.icl index 0fa632f..f451d87 100644 --- a/frontend/trans.icl +++ b/frontend/trans.icl @@ -1533,8 +1533,7 @@ generateFunction app_symb fd=:{fun_body = TransformedBody {tb_args,tb_rhs},fun_i (all_attr_vars2, ti_type_heaps) = accAttrVarHeap (getAttrVars (fresh_arg_types, fresh_result_type)) ti_type_heaps - all_attr_vars - = [ attr_var \\ TA_Var attr_var <- [fresh_attr_vars.[i] \\ i<-[0..size used_attr_vars-1] | used_attr_vars.[i]]] + all_attr_vars = get_used_attr_vars 0 used_attr_vars fresh_attr_vars # (all_fresh_type_vars, ti_type_heaps) = accTypeVarHeap (getTypeVars (fresh_arg_types, fresh_result_type)) ti_type_heaps new_fun_type @@ -1850,6 +1849,17 @@ where = var_heap = (n_args1,n_args2n,var_heap) + get_used_attr_vars :: !Int !{#Bool} !{!TypeAttribute} -> [AttributeVar] + get_used_attr_vars attr_var_n used_attr_vars fresh_attr_vars + | attr_var_n (!SymbolType,!*{#FunDef},!*FunctionHeap) get_producer_type {symb_kind=SK_Function {glob_module, glob_object}} ro fun_defs fun_heap -- cgit v1.2.3