aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartinw2000-05-03 08:58:38 +0000
committermartinw2000-05-03 08:58:38 +0000
commit701d400a231fb71d5d7de503116e9ece0158c141 (patch)
tree0a76d2510a6cd3bf77d08858cac564d9cbb1631b
parentbug fix (diff)
bugfix
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@133 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/check.icl13
-rw-r--r--frontend/comparedefimp.dcl2
-rw-r--r--frontend/comparedefimp.icl19
3 files changed, 17 insertions, 17 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index 38e8d88..ebc3d5c 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -2660,7 +2660,7 @@ checkModule {mod_type,mod_name,mod_imports,mod_imported_objects,mod_defs = cdefs
(dcl_modules, class_instances, icl_functions, cs_predef_symbols)
= adjust_instance_types_of_array_functions_in_std_array_icl dcl_modules class_instances icl_functions cs_predef_symbols
- (untransformed_macro_funs_defs, icl_functions) = memcpy cdefs.def_macros icl_functions
+ (untransformed_fun_bodies, icl_functions) = copy_bodies icl_functions
(groups, icl_functions, dcl_modules, var_heap, expr_heap, cs_symbol_table, cs_error)
= partitionateAndLiftFunctions [icl_global_function_range, icl_instances] cIclModIndex icl_functions
dcl_modules var_heap expr_heap cs_symbol_table cs_error
@@ -2673,7 +2673,7 @@ checkModule {mod_type,mod_name,mod_imports,mod_imported_objects,mod_defs = cdefs
heaps = { heaps & hp_var_heap = var_heap, hp_expression_heap = expr_heap, hp_type_heaps = {hp_type_heaps & th_vars = th_vars}}
(dcl_modules, icl_mod, heaps, cs_error)
- = compareDefImp (cdefs.def_macros.ir_from, untransformed_macro_funs_defs) dcl_modules icl_mod heaps cs_error
+ = compareDefImp untransformed_fun_bodies dcl_modules icl_mod heaps cs_error
= (cs_error.ea_ok, icl_mod, dcl_modules, groups, dcl_icl_conversions, heaps, cs_predef_symbols, cs_symbol_table, cs_error.ea_file)
# icl_common = { icl_common & com_type_defs = e_info.ef_type_defs, com_selector_defs = e_info.ef_selector_defs, com_class_defs = e_info.ef_class_defs,
@@ -2882,10 +2882,11 @@ checkModule {mod_type,mod_name,mod_imports,mod_imported_objects,mod_defs = cdefs
(Yes symbol_type) = inst_def.fun_type
= { instance_defs & [ds_index] = { inst_def & fun_type = Yes (makeElemTypeOfArrayFunctionStrict symbol_type ins_offset offset_table) } }
- memcpy :: !IndexRange !*{# FunDef} -> (!.{FunDef}, !*{# FunDef})
- memcpy {ir_from, ir_to} fun_defs
- # new = createArray (ir_to-ir_from) (abort "check.icl: don't make that array strict !")
- = iFoldSt (\i (dst, src=:{[i]=src_i})->({ dst & [i-ir_from] = src_i }, src)) ir_from ir_to (new, fun_defs)
+ copy_bodies :: !*{# FunDef} -> (!.{!FunctionBody}, !*{# FunDef})
+ copy_bodies fun_defs
+ #! size = size fun_defs
+ # new = createArray size NoBody
+ = iFoldSt (\i (dst, src=:{[i]=src_i})->({ dst & [i] = src_i.fun_body }, src)) 0 size (new, fun_defs)
check_needed_modules_are_imported mod_name extension cs=:{cs_needed_modules}
# cs = case cs_needed_modules bitand cNeedStdDynamics of
diff --git a/frontend/comparedefimp.dcl b/frontend/comparedefimp.dcl
index 9cfd6ab..8727005 100644
--- a/frontend/comparedefimp.dcl
+++ b/frontend/comparedefimp.dcl
@@ -4,6 +4,6 @@ import syntax, checksupport
// compare definition and implementation module
-compareDefImp :: !(!Int, !{FunDef}) !*{# DclModule} !*IclModule !*Heaps !*ErrorAdmin
+compareDefImp :: !{!FunctionBody} !*{# DclModule} !*IclModule !*Heaps !*ErrorAdmin
-> (!.{# DclModule}, !.IclModule,!.Heaps,!.ErrorAdmin)
diff --git a/frontend/comparedefimp.icl b/frontend/comparedefimp.icl
index 79a8ec1..aec143d 100644
--- a/frontend/comparedefimp.icl
+++ b/frontend/comparedefimp.icl
@@ -54,7 +54,7 @@ import RWSDebug
, ec_tc_state
:: !.TypesCorrespondState
, ec_untransformed
- :: !(!Int, !{ FunDef })
+ :: !{! FunctionBody }
}
:: ExpressionsCorrespondMonad
@@ -84,7 +84,7 @@ class CorrespondenceNumber a where
initial_hwn hwn_heap = { hwn_heap = hwn_heap, hwn_number = 0 }
-compareDefImp :: !(!Int, !{FunDef}) !*{# DclModule} !*IclModule !*Heaps !*ErrorAdmin
+compareDefImp :: !{!FunctionBody} !*{# DclModule} !*IclModule !*Heaps !*ErrorAdmin
-> (!.{# DclModule}, !.IclModule,!.Heaps,!.ErrorAdmin)
compareDefImp untransformed dcl_modules icl_module heaps error_admin
# (main_dcl_module, dcl_modules) = dcl_modules![cIclModIndex]
@@ -231,17 +231,16 @@ compareTwoMacroFuns dclIndex iclIndex
_ -> True
| not need_to_be_compared
= ec_state
- # adjusted_icl_function
+ # adjusted_icl_body
= case (dcl_function.fun_body, icl_function.fun_body) of
(CheckedBody _, TransformedBody _)
// the macro definition in the icl module is has been transformed but not the dcl
// module's definition: use the untransformed icl original for comparision
- # (offset, untransformed_icl_functions) = ec_untransformed
- -> untransformed_icl_functions.[iclIndex-offset]
- _ -> icl_function
+ -> ec_untransformed.[iclIndex]
+ _ -> icl_function.fun_body
ident_pos = getIdentPos dcl_function
ec_error_admin = pushErrorAdmin ident_pos ec_state.ec_error_admin
- ec_state = e_corresponds dcl_function adjusted_icl_function { ec_state & ec_error_admin = ec_error_admin }
+ ec_state = e_corresponds dcl_function.fun_body adjusted_icl_body { ec_state & ec_error_admin = ec_error_admin }
= { ec_state & ec_error_admin = popErrorAdmin ec_state.ec_error_admin }
instance getIdentPos (TypeDef a) where
@@ -706,12 +705,12 @@ instance e_corresponds DefinedSymbol where
e_corresponds dclDef iclDef
= equal2 dclDef.ds_ident iclDef.ds_ident
-instance e_corresponds FunDef where
+instance e_corresponds FunctionBody where
// both bodies are either CheckedBodies or TransformedBodies
e_corresponds dclDef iclDef
-// | False--->("compare", dclDef, iclDef)
+// | False--->("compare", from_body dclDef, from_body iclDef)
// = undef
- = e_corresponds (from_body dclDef.fun_body) (from_body iclDef.fun_body)
+ = e_corresponds (from_body dclDef) (from_body iclDef)
where
from_body (TransformedBody {tb_args, tb_rhs}) = (tb_args, [tb_rhs])
from_body (CheckedBody {cb_args, cb_rhs}) = (cb_args, cb_rhs)