Commit 23053539 authored by John van Groningen's avatar John van Groningen
Browse files

remove unused field wtis_collected_conses of WriteTypeInfoState

parent c36a78cb
......@@ -50,15 +50,11 @@ write_tcl_file main_dcl_module_n dcl_mods=:{[main_dcl_module_n] = main_dcl_modul
wtis_n_type_vars = 0
, wtis_common_defs = common_defs
, wtis_type_defs = imported_types
, wtis_collected_conses = []
, wtis_type_heaps = type_heaps
, wtis_var_heap = var_heap
, wtis_main_dcl_module_n = main_dcl_module_n
};
# (j,tcl_file)
= fposition tcl_file
#! (tcl_file,write_type_info_state)
= write_type_info icl_common_defs tcl_file write_type_info_state2
......@@ -70,7 +66,6 @@ write_tcl_file main_dcl_module_n dcl_mods=:{[main_dcl_module_n] = main_dcl_modul
with
help_20_compiler :: {#{#Char}} -> {#{#Char}}
help_20_compiler l = l
#! tcl_file
= fwritei (size main_dcl_module.dcl_common.com_type_defs) tcl_file
......@@ -208,7 +203,7 @@ instance convertDynamics TransformedBody where
share_init_subst :: BoundVar [LetBind] Expression *ConversionState
-> (Expression, *ConversionState)
share_init_subst subst global_tpv_binds rhs ci=:{ci_type_pattern_var_count, ci_type_var_count}
# (initial_unifier_symb, ci)
# (initial_unifier_symb, ci)
= getSymbol PD_Dyn_initial_unification_environment SK_Function 2 ci
# let_bind_initial_subst
......
......@@ -3,23 +3,17 @@
*/
definition module type_io
// WARNING: It is essential to report changes in this module to martijnv@cs.kun.nl
// because the binary format for type-files is used by the dynamic run-time
// system.
import scanner, general, Heap, typeproperties, utilities, checksupport
import StdEnv
import trans
:: WriteTypeInfoState
= {
wtis_n_type_vars :: !Int
, wtis_common_defs :: !{#CommonDefs}
, wtis_type_defs :: !.{#{#CheckedTypeDef}}
, wtis_collected_conses :: !ImportedConstructors
, wtis_type_heaps :: !.TypeHeaps
, wtis_var_heap :: !.VarHeap
, wtis_main_dcl_module_n :: !Int
= { wtis_n_type_vars :: !Int
, wtis_common_defs :: !{#CommonDefs}
, wtis_type_defs :: !.{#{#CheckedTypeDef}}
, wtis_type_heaps :: !.TypeHeaps
, wtis_var_heap :: !.VarHeap
, wtis_main_dcl_module_n :: !Int
};
class WriteTypeInfo a
......@@ -28,12 +22,4 @@ where
instance WriteTypeInfo CommonDefs, Char, [a] | WriteTypeInfo a
instance WriteTypeInfo StrictnessList
instance WriteTypeInfo {#b} | Array {#} b & WriteTypeInfo b
instance WriteTypeInfo (a,b) | WriteTypeInfo a & WriteTypeInfo b
instance WriteTypeInfo TypeSymbIdent
instance WriteTypeInfo Int
\ No newline at end of file
......@@ -6,8 +6,8 @@ implementation module type_io
import StdEnv, compare_constructor
import scanner, general, Heap, typeproperties, utilities, checksupport
import trans
import type_io_common
// normal form:
// - type variables in type definitions are normalized by checkTypeDef in the
// module checktypes.icl. The position of a type variable in the left-hand
......@@ -19,14 +19,12 @@ import type_io_common
// - ADTs
:: WriteTypeInfoState
= {
wtis_n_type_vars :: !Int
, wtis_common_defs :: !{#CommonDefs}
, wtis_type_defs :: !.{#{#CheckedTypeDef}}
, wtis_collected_conses :: !ImportedConstructors
, wtis_type_heaps :: !.TypeHeaps
, wtis_var_heap :: !.VarHeap
, wtis_main_dcl_module_n :: !Int
= { wtis_n_type_vars :: !Int
, wtis_common_defs :: !{#CommonDefs}
, wtis_type_defs :: !.{#{#CheckedTypeDef}}
, wtis_type_heaps :: !.TypeHeaps
, wtis_var_heap :: !.VarHeap
, wtis_main_dcl_module_n :: !Int
};
class WriteTypeInfo a
......@@ -41,13 +39,13 @@ where
= write_type_info com_cons_defs tcl_file wtis
instance WriteTypeInfo ConsDef
where
where
write_type_info {cons_ident,cons_type,cons_type_index,cons_exi_vars} tcl_file wtis=:{wtis_n_type_vars}
// normalize ...
# (th_vars,wtis)
= sel_type_var_heap wtis
# (_,(_,th_vars))
= mapSt normalize_type_var cons_exi_vars (wtis_n_type_vars,th_vars)
= mapSt normalize_type_var cons_exi_vars (wtis_n_type_vars,th_vars)
# wtis = { wtis & wtis_type_heaps.th_vars = th_vars }
// ... normalize
# (tcl_file,wtis)
......@@ -193,17 +191,12 @@ where
= write_type_info st_result tcl_file wtis
= (tcl_file,wtis)
where
expand_symbol_type symbol_type wtis=:{wtis_common_defs,wtis_type_defs,wtis_main_dcl_module_n,wtis_collected_conses,wtis_type_heaps,wtis_var_heap}
expand_symbol_type symbol_type wtis=:{wtis_common_defs,wtis_type_defs,wtis_main_dcl_module_n,wtis_type_heaps,wtis_var_heap}
# (expanded_symbol_type,wtis_type_defs,wtis_type_heaps,wtis_var_heap)
= convertSymbolTypeWithoutCollectingImportedConstructors False wtis_common_defs symbol_type wtis_main_dcl_module_n wtis_type_defs wtis_type_heaps wtis_var_heap;
# wtis
= { wtis &
wtis_type_defs = wtis_type_defs
, wtis_type_heaps = wtis_type_heaps
, wtis_var_heap = wtis_var_heap
};
# wtis = {wtis & wtis_type_defs = wtis_type_defs, wtis_type_heaps = wtis_type_heaps, wtis_var_heap = wtis_var_heap};
= (expanded_symbol_type,wtis)
instance WriteTypeInfo StrictnessList
where
write_type_info NotStrict tcl_file wtis
......@@ -385,20 +378,17 @@ where
instance WriteTypeInfo {#b} | Array {#} b & WriteTypeInfo b
where
write_type_info unboxed_array tcl_file wtis
# s_unboxed_array
= size unboxed_array
# tcl_file
= fwritei s_unboxed_array tcl_file
# s_unboxed_array = size unboxed_array
# tcl_file = fwritei s_unboxed_array tcl_file
= write_type_info_loop 0 s_unboxed_array tcl_file wtis
where
write_type_info_loop i limit tcl_file wtis
| i == limit
= (tcl_file,wtis)
# (tcl_file,wtis)
= write_type_info unboxed_array.[i] tcl_file wtis
= write_type_info_loop (inc i) limit tcl_file wtis
instance WriteTypeInfo [a] | WriteTypeInfo a
where
write_type_info l tcl_file wtis
......
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