diff options
author | johnvg | 2005-04-20 11:05:59 +0000 |
---|---|---|
committer | johnvg | 2005-04-20 11:05:59 +0000 |
commit | c5cb647c63010206cfadefa568d1dde4448de867 (patch) | |
tree | 73911f37bfd0d62508889300eeb71d2d2eca7bbb /frontend/frontend.icl | |
parent | don't print pointer values in type errors (diff) |
clear group indices of macros in dcl cache to prevent errors in computing
components when a macro in a dcl module is used
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1528 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/frontend.icl')
-rw-r--r-- | frontend/frontend.icl | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/frontend/frontend.icl b/frontend/frontend.icl index 743bde0..676c46b 100644 --- a/frontend/frontend.icl +++ b/frontend/frontend.icl @@ -42,10 +42,10 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an #! support_dynamics = case tcl_file of Yes _ -> True ; No -> False # (ok, mod, global_fun_range, mod_functions, optional_dcl_mod, modules, dcl_module_n_in_cache,n_functions_and_macros_in_dcl_modules,hash_table, error, files) = scanModule (mod -*-> "Scanning") cached_module_idents options.feo_generics support_dynamics hash_table error search_paths modtimefunction files - /* JVG: */ + // # hash_table = {hash_table & hte_entries={}} # hash_table = remove_icl_symbols_from_hash_table hash_table - /**/ + | not ok = (No,{},{},0,0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps) # symbol_table = hash_table.hte_symbol_heap @@ -80,9 +80,7 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an // # dcl_mods = {{dcl_mod & dcl_declared={dcls_import={},dcls_local=[],dcls_local_for_import={},dcls_explicit={}}}\\ dcl_mod<-:dcl_mods} - # var_heap = heaps.hp_var_heap - gen_heap = heaps.hp_generic_heap - type_heaps = heaps.hp_type_heaps + # type_heaps = heaps.hp_type_heaps fun_defs = icl_functions | options.feo_up_to_phase == FrontEndPhaseCheck @@ -275,6 +273,7 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an | ok<>ok = abort ""; */ + // # (fun_defs,out,var_heap,predef_symbols) = sa components main_dcl_module_n dcl_mods fun_defs out var_heap predef_symbols; # heaps = {hp_var_heap = var_heap, hp_expression_heap=expression_heap, hp_type_heaps=type_heaps,hp_generic_heap=heaps.hp_generic_heap} @@ -292,12 +291,33 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an , fe_arrayInstances = array_instances } + # cached_dcl_macros = clear_group_indices_of_macros cached_dcl_macros = (Yes fe,cached_dcl_macros,cached_dcl_mods,n_functions_and_macros_in_dcl_modules,main_dcl_module_n,predef_symbols,hash_table,files,error,io,out,tcl_file,heaps) where + copy_dcl_modules :: !*{#DclModule} -> *(!*{#DclModule},!*{#DclModule}) copy_dcl_modules dcl_mods #! nr_of_dcl_mods = size dcl_mods = arrayCopyBegin dcl_mods nr_of_dcl_mods + clear_group_indices_of_macros :: !*{#*{#FunDef}} -> *{#*{#FunDef}} + clear_group_indices_of_macros cached_dcl_macros + = clear_group_indices1 0 {} cached_dcl_macros + where + clear_group_indices1 :: !Int !*{#FunDef} !*{#*{#u:FunDef}} -> *{#*{#FunDef}} + clear_group_indices1 i dummy cached_dcl_macros + | i==size cached_dcl_macros + = cached_dcl_macros + # (cached_dcl_macros_i,cached_dcl_macros) = replace cached_dcl_macros i dummy + # cached_dcl_macros_i = clear_group_indices2 0 cached_dcl_macros_i + # (dummy,cached_dcl_macros) = replace cached_dcl_macros i cached_dcl_macros_i + = clear_group_indices1 (i+1) dummy cached_dcl_macros + + clear_group_indices2 j cached_dcl_macros_i + | j==size cached_dcl_macros_i + = cached_dcl_macros_i + # cached_dcl_macros_i = {cached_dcl_macros_i & [j].fun_info.fi_group_index= (-1)} + = clear_group_indices2 (j+1) cached_dcl_macros_i + newSymbolTable :: !Int -> *{# SymbolTableEntry} newSymbolTable size = createArray size { ste_index = NoIndex, ste_def_level = -1, ste_kind = STE_Empty, ste_previous = abort "PreviousPlaceholder"} |