Commit 53d4f52d authored by John van Groningen's avatar John van Groningen
Browse files

build the whole st_attr_vars list in function generateFunction, instead of building it lazily

parent a4c2cb04
......@@ -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<size used_attr_vars
| used_attr_vars.[attr_var_n]
# (TA_Var used_attr_var) = fresh_attr_vars.[attr_var_n]
#! used_attr_var = used_attr_var
#! used_attr_vars = get_used_attr_vars (attr_var_n+1) used_attr_vars fresh_attr_vars
= [used_attr_var : used_attr_vars]
= get_used_attr_vars (attr_var_n+1) used_attr_vars fresh_attr_vars
= []
// get_producer_type retrieves the type of symbol
get_producer_type :: !SymbIdent !.ReadOnlyTI !*{#FunDef} !*FunctionHeap -> (!SymbolType,!*{#FunDef},!*FunctionHeap)
get_producer_type {symb_kind=SK_Function {glob_module, glob_object}} ro fun_defs fun_heap
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment