diff options
author | johnvg | 2012-08-16 09:37:32 +0000 |
---|---|---|
committer | johnvg | 2012-08-16 09:37:32 +0000 |
commit | 467696b7a7ae1e94d073cde1d1cdb7df65d0fd3c (patch) | |
tree | 5c9028040cab79029470d4ecc98f18492928d363 /frontend/type.icl | |
parent | optimize function get_mark (diff) |
optimize local function new_inequality in determine_attribute_of_cons,
(the inequality is often already present)
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2156 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r-- | frontend/type.icl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/frontend/type.icl b/frontend/type.icl index 51ba6d2..fe3c7a5 100644 --- a/frontend/type.icl +++ b/frontend/type.icl @@ -940,7 +940,7 @@ freshSymbolType is_appl fresh_context_vars {st_vars,st_args,st_result,st_context = collect_cons_variables tc_types class_cons_vars collected_cons_vars collect_cons_variables_in_tc common_defs tc=:{tc_class=TCGeneric {gtc_class}} collected_cons_vars = collect_cons_variables_in_tc common_defs {tc & tc_class=TCClass gtc_class} collected_cons_vars - + collect_cons_variables [] class_cons_vars collected_cons_vars = collected_cons_vars collect_cons_variables [type : tc_types] class_cons_vars collected_cons_vars @@ -1133,7 +1133,6 @@ where = case cumm_attr of TA_Unique -> (TA_Unique, attr_var_heap, attr_vars, attr_env, attribute_error attr_var ps_error) - TA_Multi -> (TA_Var attr_var, attr_var_heap, attr_vars, attr_env, ps_error) TA_Var _ @@ -1141,13 +1140,17 @@ where _ -> abort ("combine_attributes" ---> cumm_attr) where - new_inequality off_attr_var dem_attr_var [] - = [{ ai_demanded = dem_attr_var, ai_offered = off_attr_var }] - new_inequality off_attr_var dem_attr_var ins=:[ inequal : iequals ] - | dem_attr_var.av_info_ptr == inequal.ai_demanded.av_info_ptr && off_attr_var.av_info_ptr == inequal.ai_offered.av_info_ptr - = ins - = [ inequal : new_inequality off_attr_var dem_attr_var iequals ] + new_inequality off_attr_var dem_attr_var inequals + | is_new_inequality off_attr_var dem_attr_var inequals + = inequals ++ [{ ai_demanded = dem_attr_var, ai_offered = off_attr_var }] + = inequals + is_new_inequality off_attr_var dem_attr_var [inequal : iequals] + | dem_attr_var.av_info_ptr == inequal.ai_demanded.av_info_ptr && off_attr_var.av_info_ptr == inequal.ai_offered.av_info_ptr + = False + = is_new_inequality off_attr_var dem_attr_var iequals + is_new_inequality off_attr_var dem_attr_var [] + = True combine_attributes _ (TA_Var var) prop_vars attr_var_heap attr_vars attr_env ps_error # (new_attr_ptr, attr_var_heap) = newPtr AVI_Empty attr_var_heap new_attr_var = { var & av_info_ptr = new_attr_ptr } |