From ed7bf4f9159a87e4e9b003507645be0b3d594295 Mon Sep 17 00:00:00 2001 From: diederik Date: Mon, 4 Nov 2002 11:02:26 +0000 Subject: Fix so that correctness of EI_LetType is maintained during repartitioning git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1267 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/transform.icl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/transform.icl b/frontend/transform.icl index af78614..f2bed8e 100644 --- a/frontend/transform.icl +++ b/frontend/transform.icl @@ -1829,7 +1829,13 @@ where collectVariables (expr @ exprs) free_vars dynamics cos # ((expr, exprs), free_vars, dynamics, cos) = collectVariables (expr, exprs) free_vars dynamics cos = (expr @ exprs, free_vars, dynamics, cos) - collectVariables (Let lad=:{let_strict_binds, let_lazy_binds, let_expr}) free_vars dynamics cos=:{cos_var_heap} + collectVariables (Let lad=:{let_strict_binds, let_lazy_binds, let_expr, let_info_ptr}) free_vars dynamics cos=:{cos_var_heap} + # (let_info,cos_symbol_heap) = readPtr let_info_ptr cos.cos_symbol_heap + zipped_let_info = case let_info of + EI_LetType let_types -> [(lb_dst.fv_info_ptr,type) \\ {lb_dst} <- let_strict_binds ++ let_lazy_binds & type <- let_types] + _ -> [] + cos = {cos & cos_symbol_heap = cos_symbol_heap} + cos_var_heap = cos.cos_var_heap # cos_var_heap = determine_aliases let_strict_binds cos_var_heap cos_var_heap = determine_aliases let_lazy_binds cos_var_heap (is_cyclic_s, let_strict_binds, cos) @@ -1847,8 +1853,17 @@ where (let_strict_binds, let_lazy_binds) = split collected_binds | isEmpty let_strict_binds && isEmpty let_lazy_binds = (let_expr, free_vars, dynamics, cos) + # let_info = case let_info of + EI_LetType _ -> EI_LetType (retrieve_types zipped_let_info (let_strict_binds ++ let_lazy_binds)) + _ -> let_info + cos_symbol_heap = writePtr let_info_ptr let_info cos.cos_symbol_heap + cos = {cos & cos_symbol_heap = cos_symbol_heap} = (Let {lad & let_expr = let_expr, let_strict_binds = let_strict_binds, let_lazy_binds = let_lazy_binds}, free_vars, dynamics, cos) where + retrieve_types _ [] = [] + retrieve_types [(dst,type):zipped] binds=:[{lb_dst}:rest_binds] + | dst == lb_dst.fv_info_ptr = [type : retrieve_types zipped rest_binds] + = retrieve_types zipped binds /* Set the 'var_info_field' of each bound variable to either 'VI_Alias var' (if this variable is an alias for 'var') or to 'VI_Count 0 cIsALocalVar' to initialise -- cgit v1.2.3