diff options
author | johnvg | 2012-07-09 12:29:57 +0000 |
---|---|---|
committer | johnvg | 2012-07-09 12:29:57 +0000 |
commit | 04ce2dc9706fa8d4377b500659a27c286ab6ba24 (patch) | |
tree | 1cac2612f09a5a99a27985500fb279b535386b6d /frontend/trans.icl | |
parent | remove limit on the size of the converted syntax tree in the strictness analyzer (diff) |
compute class_types using a comprehension instead of a fold with some unused values
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2110 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/trans.icl')
-rw-r--r-- | frontend/trans.icl | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/frontend/trans.icl b/frontend/trans.icl index ea098b9..b3d905f 100644 --- a/frontend/trans.icl +++ b/frontend/trans.icl @@ -1434,17 +1434,12 @@ generateFunction app_symb fd=:{fun_body = TransformedBody {tb_args,tb_rhs},fun_i (opt_sound_function_producer_types, ti_type_heaps) = mapSt copy_opt_symbol_type opt_sound_function_producer_types ti_type_heaps - sound_function_producer_types // nog even voor determine args.... - = [x \\ Yes x <- opt_sound_function_producer_types] + sound_function_producer_types = [x \\ Yes x <- opt_sound_function_producer_types] - # {st_attr_vars,st_args,st_args_strictness,st_result,st_attr_env} - = sound_consumer_symbol_type + # {st_attr_vars,st_args,st_args_strictness,st_result,st_attr_env} = sound_consumer_symbol_type - (class_types, ti_fun_defs, ti_fun_heap) - = iFoldSt (accum_class_type prods ro) 0 (size prods) - ([], ti_fun_defs, ti_fun_heap) - (type_vars_in_class_types, th_vars) - = mapSt getTypeVars class_types ti_type_heaps.th_vars + class_types = [{at_attribute = TA_Multi, at_type = class_type} \\ PR_Class _ _ class_type <-:prods] + (type_vars_in_class_types, th_vars) = mapSt getTypeVars class_types ti_type_heaps.th_vars all_involved_types = class_types ++ (flatten (map (\{st_args, st_result}-> [st_result:st_args]) @@ -1832,14 +1827,6 @@ where # (type, prop_class, ps) = addPropagationAttributesToAType modules type ps = (type, ps) - accum_class_type :: !{!.Producer} !.ReadOnlyTI !.Int !(!u:[v:AType],!.b,!.c) -> (!w:[x:AType],!.b,!.c), [u <= w,v <= x] - accum_class_type prods ro i (type_accu, ti_fun_defs, ti_fun_heap) - = case prods.[i] of - PR_Class _ _ class_type - -> ([{empty_atype & at_type = class_type} : type_accu ], ti_fun_defs, ti_fun_heap) - _ - -> (type_accu, ti_fun_defs, ti_fun_heap) - accum_function_producer_type :: !{!.Producer} !.ReadOnlyTI !.Int !*(!u:[v:(Optional .SymbolType)],!*{#.FunDef},!*(Heap FunctionInfo)) -> (!w:[x:(Optional SymbolType)],!.{#FunDef},!.(Heap FunctionInfo)), [u <= w,v <= x] accum_function_producer_type prods ro i (type_accu, ti_fun_defs, ti_fun_heap) = case prods.[size prods-i-1] of |