Commit 229880eb authored by Martin Wierich's avatar Martin Wierich
Browse files

bugfix: explicit imports of instances did not work in conjunction with dcl

caching
parent e6ba10e3
......@@ -1928,6 +1928,14 @@ updateExplImpInfo super_components mod_index dcls_import dcls_local_for_import
dcl_modules expl_imp_infos cs_symbol_table
# (changed_symbols, (expl_imp_infos, cs_symbol_table))
= mapSt markExplImpSymbols super_components (expl_imp_infos, cs_symbol_table)
cs_symbol_table
= switch_import_syntax
(foldlArraySt opt_store_instance_with_class_symbol dcls_local_for_import cs_symbol_table)
cs_symbol_table
cs_symbol_table
= switch_import_syntax
(foldlArraySt opt_store_instance_with_class_symbol dcls_import cs_symbol_table)
cs_symbol_table
(dcl_modules, expl_imp_infos, cs_symbol_table)
= foldlArraySt (update_expl_imp_for_marked_symbol mod_index) dcls_local_for_import
(dcl_modules, expl_imp_infos, cs_symbol_table)
......@@ -1939,6 +1947,16 @@ updateExplImpInfo super_components mod_index dcls_import dcls_local_for_import
changed_symbols cs_symbol_table
= (dcl_modules, expl_imp_infos, cs_symbol_table)
opt_store_instance_with_class_symbol decl=:{dcl_kind=STE_Imported (STE_Instance class_ident) _} cs_symbol_table
/* This function is only for old import syntax.
All declared instances for a class have to be collected
*/
= optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table
opt_store_instance_with_class_symbol _ cs_symbol_table
= cs_symbol_table
update_expl_imp_for_marked_symbol mod_index decl=:{dcl_ident} (dcl_modules, expl_imp_infos, cs_symbol_table)
# (ste, cs_symbol_table)
= readPtr dcl_ident.id_info cs_symbol_table
......
......@@ -19,6 +19,9 @@ markExplImpSymbols :: !Int !*(!*{!*{!u:ExplImpInfo}}, !*SymbolTable)
updateExplImpForMarkedSymbol :: !Index !Declaration !SymbolTableEntry !u:{#DclModule} !{!{!*ExplImpInfo}} !*SymbolTable
-> (!u:{#DclModule}, !{!{!.ExplImpInfo}}, !.SymbolTable)
optStoreInstanceWithClassSymbol :: Declaration !Ident !*SymbolTable
-> .SymbolTable
solveExplicitImports :: !(IntKeyHashtable [(Int,Position,[ImportNrAndIdents])]) !{#Int} !Index
!*(!v:{#DclModule},!*{#Int},!{!*ExplImpInfo},!*CheckState)
-> (!.SolvedImports,!(!v:{#DclModule},!.{#Int},!{!.ExplImpInfo},!.CheckState))
......
......@@ -70,16 +70,6 @@ updateExplImpForMarkedSymbol mod_index decl {ste_kind=STE_ExplImpComponentNrs co
dcl_modules expl_imp_infos cs_symbol_table
= foldSt (addExplImpInfo mod_index decl inst_indices) component_numbers
(dcl_modules, expl_imp_infos, cs_symbol_table)
updateExplImpForMarkedSymbol _ decl {ste_kind=STE_Instance class_ident} dcl_modules expl_imp_infos cs_symbol_table
// this alternative is only for old syntax (cs_symbol_table argument is not necessary for new syntax)
# cs_symbol_table
= optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table
= (dcl_modules, expl_imp_infos, cs_symbol_table)
updateExplImpForMarkedSymbol _ decl {ste_kind=STE_Imported (STE_Instance class_ident) _} dcl_modules expl_imp_infos cs_symbol_table
// this alternative is only for old syntax (cs_symbol_table argument is not necessary for new syntax)
# cs_symbol_table
= optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table
= (dcl_modules, expl_imp_infos, cs_symbol_table)
updateExplImpForMarkedSymbol _ _ entry dcl_modules expl_imp_infos cs_symbol_table
= (dcl_modules, expl_imp_infos, cs_symbol_table)
......@@ -119,6 +109,7 @@ addExplImpInfo mod_index decl instances { cai_component_nr, cai_index } (dcl_mod
)
optStoreInstanceWithClassSymbol :: Declaration !Ident !*SymbolTable -> .SymbolTable
optStoreInstanceWithClassSymbol decl class_ident cs_symbol_table
// this function is only for old syntax
| switch_import_syntax False True
......
Markdown is supported
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