Commit 9c8693d5 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏘
Browse files

pass file modification times from icl module and dcl modules to backend

parent 12b588d4
......@@ -251,10 +251,10 @@ BEAbcCodeBlock :: !Bool !BEStringListP !BackEnd -> (!BECodeBlockP,!BackEnd);
// BECodeBlockP BEAbcCodeBlock (int inline,BEStringListP instructions);
BEAnyCodeBlock :: !BECodeParameterP !BECodeParameterP !BEStringListP !BackEnd -> (!BECodeBlockP,!BackEnd);
// BECodeBlockP BEAnyCodeBlock (BECodeParameterP inParams,BECodeParameterP outParams,BEStringListP instructions);
BEDeclareIclModule :: !String !Int !Int !Int !Int !BackEnd -> BackEnd;
// void BEDeclareIclModule (CleanString name,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclareDclModule :: !Int !String !Bool !Int !Int !Int !Int !BackEnd -> BackEnd;
// void BEDeclareDclModule (int moduleIndex,CleanString name,int systemModule,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclareIclModule :: !String !String !Int !Int !Int !Int !BackEnd -> BackEnd;
// void BEDeclareIclModule (CleanString name,CleanString modificationTime,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclareDclModule :: !Int !String !String !Bool !Int !Int !Int !Int !BackEnd -> BackEnd;
// void BEDeclareDclModule (int moduleIndex,CleanString name,CleanString modificationTime,int systemModule,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclarePredefinedModule :: !Int !Int !BackEnd -> BackEnd;
// void BEDeclarePredefinedModule (int nTypes,int nConstructors);
BEDefineRules :: !BEImpRuleP !BackEnd -> BackEnd;
......@@ -279,9 +279,9 @@ BEDeclareDynamicTypeSymbol :: !Int !Int !BackEnd -> BackEnd;
// void BEDeclareDynamicTypeSymbol (int typeIndex,int moduleIndex);
BEDynamicTempTypeSymbol :: !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BEDynamicTempTypeSymbol ();
kBEVersionCurrent:==0x02000212;
kBEVersionOldestDefinition:==0x02000212;
kBEVersionOldestImplementation:==0x02000212;
kBEVersionCurrent:==0x02000213;
kBEVersionOldestDefinition:==0x02000213;
kBEVersionOldestImplementation:==0x02000213;
kBEDebug:==1;
kPredefinedModuleIndex:==1;
BENoAnnot:==0;
......
......@@ -680,17 +680,17 @@ BEAnyCodeBlock a0 a1 a2 a3 = code {
};
// BECodeBlockP BEAnyCodeBlock (BECodeParameterP inParams,BECodeParameterP outParams,BEStringListP instructions);
BEDeclareIclModule :: !String !Int !Int !Int !Int !BackEnd -> BackEnd;
BEDeclareIclModule a0 a1 a2 a3 a4 a5 = code {
ccall BEDeclareIclModule "SIIII:V:I"
BEDeclareIclModule :: !String !String !Int !Int !Int !Int !BackEnd -> BackEnd;
BEDeclareIclModule a0 a1 a2 a3 a4 a5 a6 = code {
ccall BEDeclareIclModule "SSIIII:V:I"
};
// void BEDeclareIclModule (CleanString name,int nFunctions,int nTypes,int nConstructors,int nFields);
// void BEDeclareIclModule (CleanString name,CleanString modificationTime,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclareDclModule :: !Int !String !Bool !Int !Int !Int !Int !BackEnd -> BackEnd;
BEDeclareDclModule a0 a1 a2 a3 a4 a5 a6 a7 = code {
ccall BEDeclareDclModule "ISIIIII:V:I"
BEDeclareDclModule :: !Int !String !String !Bool !Int !Int !Int !Int !BackEnd -> BackEnd;
BEDeclareDclModule a0 a1 a2 a3 a4 a5 a6 a7 a8 = code {
ccall BEDeclareDclModule "ISSIIIII:V:I"
};
// void BEDeclareDclModule (int moduleIndex,CleanString name,int systemModule,int nFunctions,int nTypes,int nConstructors,int nFields);
// void BEDeclareDclModule (int moduleIndex,CleanString name,CleanString modificationTime,int systemModule,int nFunctions,int nTypes,int nConstructors,int nFields);
BEDeclarePredefinedModule :: !Int !Int !BackEnd -> BackEnd;
BEDeclarePredefinedModule a0 a1 a2 = code {
......@@ -763,9 +763,9 @@ BEDynamicTempTypeSymbol a0 = code {
ccall BEDynamicTempTypeSymbol ":I:I"
};
// BESymbolP BEDynamicTempTypeSymbol ();
kBEVersionCurrent:==0x02000212;
kBEVersionOldestDefinition:==0x02000212;
kBEVersionOldestImplementation:==0x02000212;
kBEVersionCurrent:==0x02000213;
kBEVersionOldestDefinition:==0x02000213;
kBEVersionOldestImplementation:==0x02000213;
kBEDebug:==1;
kPredefinedModuleIndex:==1;
BENoAnnot:==0;
......
......@@ -383,7 +383,7 @@ backEndConvertModules p s main_dcl_module_n var_heap attr_var_heap be
backEndConvertModulesH :: PredefinedSymbols FrontEndSyntaxTree !Int *BackEndState -> *BackEndState
backEndConvertModulesH predefs {fe_icl =
fe_icl =: {icl_name, icl_functions, icl_common,icl_imported_objects,icl_used_module_numbers},
fe_icl =: {icl_name, icl_modification_time, icl_functions, icl_common,icl_imported_objects,icl_used_module_numbers},
fe_components, fe_dcls, fe_arrayInstances, fe_dclIclConversions, fe_iclDclConversions,fe_globalFunctions}
main_dcl_module_n backEnd
// sanity check ...
......@@ -448,7 +448,7 @@ backEndConvertModulesH predefs {fe_icl =
= defineOtherDclModules fe_dcls main_dcl_module_n icl_used_module_numbers (backEnd -*-> "defineOtherDclModules")
#! backEnd
= appBackEnd (BEDeclareIclModule icl_name.id_name (size icl_functions) (size icl_common.com_type_defs) (size icl_common.com_cons_defs) (size icl_common.com_selector_defs)) (backEnd -*-> "BEDeclareIclModule")
= appBackEnd (BEDeclareIclModule icl_name.id_name icl_modification_time (size icl_functions) (size icl_common.com_type_defs) (size icl_common.com_cons_defs) (size icl_common.com_selector_defs)) (backEnd -*-> "BEDeclareIclModule")
#! backEnd
= declareFunctionSymbols icl_functions (getConversions fe_iclDclConversions) functionIndices fe_globalFunctions (backEnd -*-> "declareFunctionSymbols")
with
......@@ -522,12 +522,12 @@ isSystem _
declareCurrentDclModule :: IclModule DclModule Int -> BackEnder
declareCurrentDclModule _ {dcl_module_kind=MK_None} _
= identity
declareCurrentDclModule {icl_common} {dcl_name, dcl_functions, dcl_module_kind, dcl_common} main_dcl_module_n
= appBackEnd (BEDeclareDclModule main_dcl_module_n dcl_name.id_name (isSystem dcl_module_kind) (size dcl_functions) (size icl_common.com_type_defs) (size dcl_common.com_cons_defs) (size dcl_common.com_selector_defs))
declareCurrentDclModule {icl_common} {dcl_name, dcl_modification_time, dcl_functions, dcl_module_kind, dcl_common} main_dcl_module_n
= appBackEnd (BEDeclareDclModule main_dcl_module_n dcl_name.id_name dcl_modification_time (isSystem dcl_module_kind) (size dcl_functions) (size icl_common.com_type_defs) (size dcl_common.com_cons_defs) (size dcl_common.com_selector_defs))
declareDclModule :: ModuleIndex DclModule -> BackEnder
declareDclModule moduleIndex {dcl_name, dcl_common, dcl_functions, dcl_module_kind}
= appBackEnd (BEDeclareDclModule moduleIndex dcl_name.id_name (isSystem dcl_module_kind) (size dcl_functions) (size dcl_common.com_type_defs) (size dcl_common.com_cons_defs) (size dcl_common.com_selector_defs))
declareDclModule moduleIndex {dcl_name, dcl_modification_time, dcl_common, dcl_functions, dcl_module_kind}
= appBackEnd (BEDeclareDclModule moduleIndex dcl_name.id_name dcl_modification_time (isSystem dcl_module_kind) (size dcl_functions) (size dcl_common.com_type_defs) (size dcl_common.com_cons_defs) (size dcl_common.com_selector_defs))
/*
defineCurrentDclModule :: IclModule DclModule {#Int} -> BackEnder
defineCurrentDclModule {icl_common} {dcl_name, dcl_common, dcl_functions, dcl_is_system, dcl_conversions} typeConversions
......
......@@ -367,7 +367,7 @@ BESetMainDclModuleN (int main_dcl_module_n_parameter)
}
void
BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstructors, int nFields)
BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctions, int nTypes, int nConstructors, int nFields)
{
int i;
char *cName;
......@@ -399,6 +399,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
iclModule = icl->beicl_module;
iclModule->im_name = moduleNameSymbol;
iclModule->im_modification_time = ConvertCleanString (modificationTime);
iclModule->im_def_module = NULL;
iclModule->im_rules = NULL;
iclModule->im_start = NULL;
......@@ -431,7 +432,7 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct
} /* BEDeclareIclModule */
void
BEDeclareDclModule (int moduleIndex, CleanString name, int isSystemModule, int nFunctions, int nTypes, int nConstructors, int nFields)
BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationTime, int isSystemModule, int nFunctions, int nTypes, int nConstructors, int nFields)
{
char *cName;
SymbolP moduleNameSymbol;
......@@ -453,6 +454,7 @@ BEDeclareDclModule (int moduleIndex, CleanString name, int isSystemModule, int n
dclModule = ConvertAllocType (DefRepr);
dclModule->dm_name = moduleNameSymbol;
dclModule->dm_modification_time = ConvertCleanString (modificationTime);
dclModule->dm_system_module = isSystemModule;
dclModule->dm_symbols = gBEState.be_allSymbols; /* ??? too many symbols? */
......
/* version info */
// increment this for every release
# define kBEVersionCurrent 0x02000212
# define kBEVersionCurrent 0x02000213
// change this to the same value as kBEVersionCurrent if the new release is not
// upward compatible (for example when a function is added)
# define kBEVersionOldestDefinition 0x02000212
# define kBEVersionOldestDefinition 0x02000213
// change this to the same value as kBEVersionCurrent if the new release is not
// downward compatible (for example when a function is removed)
# define kBEVersionOldestImplementation 0x02000212
# define kBEVersionOldestImplementation 0x02000213
# define kBEDebug 1
......@@ -491,11 +491,11 @@ Clean (BEAbcCodeBlock:: Bool BEStringListP BackEnd -> (BECodeBlockP, BackEnd))
BECodeBlockP BEAnyCodeBlock (BECodeParameterP inParams, BECodeParameterP outParams, BEStringListP instructions);
Clean (BEAnyCodeBlock:: BECodeParameterP BECodeParameterP BEStringListP BackEnd -> (BECodeBlockP, BackEnd))
void BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstructors, int nFields);
Clean (BEDeclareIclModule :: String Int Int Int Int BackEnd -> BackEnd)
void BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctions, int nTypes, int nConstructors, int nFields);
Clean (BEDeclareIclModule :: String String Int Int Int Int BackEnd -> BackEnd)
void BEDeclareDclModule (int moduleIndex, CleanString name, int systemModule, int nFunctions, int nTypes, int nConstructors, int nFields);
Clean (BEDeclareDclModule :: Int String Bool Int Int Int Int BackEnd -> BackEnd)
void BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationTime, int systemModule, int nFunctions, int nTypes, int nConstructors, int nFields);
Clean (BEDeclareDclModule :: Int String String Bool Int Int Int Int BackEnd -> BackEnd)
void BEDeclarePredefinedModule (int nTypes, int nConstructors);
Clean (BEDeclarePredefinedModule :: Int Int BackEnd -> BackEnd)
......
#define CLEAN2
#define CLEAN2 1
#define SHORT_CLASS_NAMES
#define U_RECORD_SELECTORS 1
......
......@@ -3200,7 +3200,7 @@ void GenFieldSelectorDescriptor (SymbDef sdef,int has_gc_apply_entry)
void GenModuleDescriptor (
#if WRITE_DCL_MODIFICATION_TIME
FileTime file_time
ModuleFileTime file_time
#else
void
#endif
......@@ -3213,7 +3213,11 @@ void GenModuleDescriptor (
if (WriteModificationTimes){
FPutC (' ',OutFile);
FPutC ('\"',OutFile);
# if CLEAN2
FPutS (file_time,OutFile);
# else
FWriteFileTime (file_time,OutFile);
# endif
FPutC ('\"',OutFile);
}
#endif
......@@ -3221,7 +3225,7 @@ void GenModuleDescriptor (
void GenDepend (char *modname
#if WRITE_DCL_MODIFICATION_TIME
,FileTime file_time
,ModuleFileTime file_time
#endif
)
{
......@@ -3235,7 +3239,11 @@ void GenDepend (char *modname
if (WriteModificationTimes){
FPutC (' ',OutFile);
FPutC ('\"',OutFile);
# if CLEAN2
FPutS (file_time,OutFile);
# else
FWriteFileTime (file_time,OutFile);
# endif
FPutC ('\"',OutFile);
}
#endif
......
......@@ -173,8 +173,8 @@ void GenStrictConstructorDescriptor (SymbDef sdef,StateP constructor_arg_state_p
void GenArrayFunctionDescriptor (SymbDef arr_fun_def, Label desclab, int arity);
#if defined(WRITE_DCL_MODIFICATION_TIME) && WRITE_DCL_MODIFICATION_TIME
void GenModuleDescriptor (FileTime file_time);
void GenDepend (char *modname,FileTime file_time);
void GenModuleDescriptor (ModuleFileTime file_time);
void GenDepend (char *modname,ModuleFileTime file_time);
#else
void GenModuleDescriptor (void);
void GenDepend (char *modname);
......
......@@ -935,6 +935,12 @@ struct string_list {
};
#endif
#if CLEAN2
typedef char * ModuleFileTime;
#else
typedef FileTime ModuleFileTime;
#endif
typedef struct {
Symbol im_name;
Symbol im_symbols;
......@@ -957,7 +963,7 @@ typedef struct {
struct string_list * im_imported_libs;
#endif
#if WRITE_DCL_MODIFICATION_TIME
FileTime im_modification_time;
ModuleFileTime im_modification_time;
#endif
} *ImpMod, ImpRepr;
......@@ -979,6 +985,6 @@ struct def_repr {
struct module_info * dm_module_info;
#endif
#if WRITE_DCL_MODIFICATION_TIME
FileTime dm_modification_time;
ModuleFileTime dm_modification_time;
#endif
};
......@@ -1582,7 +1582,7 @@ checkModule m icl_global_function_range fun_defs n_functions_and_macros_in_dcl_m
# icl_instance_range = {ir_from = first_inst_index, ir_to = nr_of_functions}
// llslsls CheckState
= check_module2 mod_name mod_imported_objects mod_imports mod_type icl_global_function_range icl_instance_range nr_of_functions n_functions_and_macros_in_dcl_modules optional_pre_def_mod local_defs icl_functions init_dcl_modules cdefs sizes heaps cs
= check_module2 mod_name m.mod_modification_time mod_imported_objects mod_imports mod_type icl_global_function_range icl_instance_range nr_of_functions n_functions_and_macros_in_dcl_modules optional_pre_def_mod local_defs icl_functions init_dcl_modules cdefs sizes heaps cs
check_module1 {mod_type,mod_name,mod_imports,mod_imported_objects,mod_defs = cdefs} icl_global_function_range fun_defs optional_dcl_mod optional_pre_def_mod scanned_modules dcl_modules functions_and_macros dcl_module_n_in_cache predef_symbols symbol_table err_file
# error = {ea_file = err_file, ea_loc = [], ea_ok = True }
......@@ -1750,12 +1750,12 @@ add_function_conversion_table dcl_to_icl_function_conversions main_dcl_module_n
# dcl_modules = {dcl_modules & [main_dcl_module_n].dcl_conversions=Yes conversion_table}
-> dcl_modules
check_module2 :: Ident [.ImportedObject] .[Import ImportDeclaration] .ModuleKind !.IndexRange !.IndexRange !Int !Int
check_module2 :: Ident {#Char} [.ImportedObject] .[Import ImportDeclaration] .ModuleKind !.IndexRange !.IndexRange !Int !Int
(Optional (Module a)) [Declaration] *{#FunDef} *{#DclModule} (CollectedDefinitions ClassInstance IndexRange)
*{#.Int} *Heaps *CheckState
-> (!Bool,.IclModule,!.{#DclModule},.{!Group},!Optional {#Int},!.{#FunDef},!Int,!.Heaps,!.{#PredefinedSymbol},
!.Heap SymbolTableEntry,!.File,[String]);
check_module2 mod_name mod_imported_objects mod_imports mod_type icl_global_function_range icl_instance_range nr_of_functions n_functions_and_macros_in_dcl_modules optional_pre_def_mod local_defs icl_functions init_dcl_modules cdefs sizes heaps cs
check_module2 mod_name mod_modification_time mod_imported_objects mod_imports mod_type icl_global_function_range icl_instance_range nr_of_functions n_functions_and_macros_in_dcl_modules optional_pre_def_mod local_defs icl_functions init_dcl_modules cdefs sizes heaps cs
# (main_dcl_module_n,cs)=cs!cs_x.x_main_dcl_module_n
(icl_sizes_without_added_dcl_defs, sizes) = memcpy sizes
(copied_dcl_defs, dcl_modules, local_defs, cdefs, icl_sizes, cs)
......@@ -1910,7 +1910,7 @@ check_module2 mod_name mod_imported_objects mod_imports mod_type icl_global_func
com_instance_defs = class_instances }
icl_mod = { icl_name = mod_name, icl_functions = icl_functions, icl_common = icl_common, icl_instances = icl_instances, icl_specials = icl_specials,
icl_imported_objects = mod_imported_objects, icl_used_module_numbers = imported_module_numbers, icl_copied_from_dcl = copied_dcl_defs,
icl_import = icl_imported }
icl_import = icl_imported, icl_modification_time = mod_modification_time}
heaps = { heaps & hp_var_heap = var_heap, hp_expression_heap = expr_heap, hp_type_heaps = {hp_type_heaps & th_vars = th_vars}}
......@@ -1929,7 +1929,7 @@ check_module2 mod_name mod_imported_objects mod_imports mod_type icl_global_func
icl_instances = icl_instance_range,
icl_specials = {ir_from = nr_of_functions, ir_to = nr_of_functions},
icl_imported_objects = mod_imported_objects, icl_used_module_numbers = imported_module_numbers, icl_copied_from_dcl = copied_dcl_defs,
icl_import = icl_imported }
icl_import = icl_imported, icl_modification_time = mod_modification_time}
= (False, icl_mod, dcl_modules, {}, No, {}, cs_x.x_main_dcl_module_n,heaps, cs_predef_symbols, cs_symbol_table, cs_error.ea_file, directly_imported_dcl_modules)
where
check_start_rule mod_kind mod_name {ir_from, ir_to} cs=:{cs_predef_symbols,cs_symbol_table,cs_x}
......@@ -2204,7 +2204,7 @@ makeElemTypeOfArrayFunctionStrict st=:{st_args,st_result} me_offset offset_table
st_result = { st_result & at_type = TA tuple [{ elem & at_annotation = AN_Strict } : res_array]}}
= st
initialDclModule ({mod_name, mod_defs=mod_defs=:{def_funtypes,def_macros}, mod_type}, sizes, all_defs) module_n
initialDclModule ({mod_name, mod_modification_time, mod_defs=mod_defs=:{def_funtypes,def_macros}, mod_type}, sizes, all_defs) module_n
# dcl_common= createCommonDefinitions mod_defs
= { dcl_name = mod_name
, dcl_functions = { function \\ function <- mod_defs.def_funtypes }
......@@ -2226,6 +2226,7 @@ initialDclModule ({mod_name, mod_defs=mod_defs=:{def_funtypes,def_macros}, mod_t
_ -> False
*/
, dcl_module_kind = mod_type
, dcl_modification_time = mod_modification_time
// ... RWS
, dcl_imported_module_numbers = EndNumbers
}
......
......@@ -98,6 +98,9 @@ cConversionTableSize :== 9 // AA
, icl_imported_objects :: ![ImportedObject]
, icl_used_module_numbers :: !NumberSet
, icl_copied_from_dcl :: !CopiedDefinitions
// RWS ...
, icl_modification_time :: !{#Char}
// ... RWS
}
:: DclModule =
......@@ -112,6 +115,7 @@ cConversionTableSize :== 9 // AA
, dcl_conversions :: !Optional ConversionTable
// RWS ... , dcl_is_system :: !Bool
, dcl_module_kind :: !ModuleKind
, dcl_modification_time:: !{#Char}
// ... RWS
, dcl_imported_module_numbers :: !NumberSet
}
......
......@@ -111,6 +111,9 @@ where
, icl_imported_objects :: ![ImportedObject]
, icl_used_module_numbers :: !NumberSet
, icl_copied_from_dcl :: !CopiedDefinitions
// RWS ...
, icl_modification_time :: !{#Char}
// ... RWS
}
:: DclModule =
......@@ -125,6 +128,7 @@ where
, dcl_conversions :: !Optional ConversionTable
// RWS ... , dcl_is_system :: !Bool
, dcl_module_kind :: !ModuleKind
, dcl_modification_time:: !{#Char}
// ... RWS
, dcl_imported_module_numbers :: !NumberSet
}
......
......@@ -31,5 +31,5 @@ import checksupport, transform, overloading
| FrontEndPhaseConvertModules
| FrontEndPhaseAll
frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !{#FunDef} !(Optional Bool) !*PredefinedSymbols !*HashTable !*Files !*File !*File !*File (!Optional !*File) !*Heaps
frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !{#FunDef} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File (!Optional !*File) !*Heaps
-> ( !Optional *FrontEndSyntaxTree,!*{# FunDef },!{#DclModule},!Int,!Int,!*PredefinedSymbols, !*HashTable, !*Files, !*File, !*File, !*File, !Optional !*File, !*Heaps)
......@@ -83,20 +83,20 @@ frontSyntaxTree cached_functions_and_macros cached_dcl_mods n_functions_and_macr
// import StdDebug
frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !{#FunDef} !(Optional Bool) !*PredefinedSymbols !*HashTable !*Files !*File !*File !*File (!Optional !*File) !*Heaps
frontEndInterface :: !FrontEndOptions !Ident !SearchPaths !{#DclModule} !{#FunDef} !(Optional Bool) !*PredefinedSymbols !*HashTable (ModTimeFunction *Files) !*Files !*File !*File !*File (!Optional !*File) !*Heaps
-> ( !Optional *FrontEndSyntaxTree,!*{# FunDef },!{#DclModule},!Int,!Int,!*PredefinedSymbols, !*HashTable, !*Files, !*File, !*File, !*File, !Optional !*File, !*Heaps)
frontEndInterface options mod_ident search_paths cached_dcl_modules functions_and_macros list_inferred_types predef_symbols hash_table files error io out tcl_file heaps
frontEndInterface options mod_ident search_paths cached_dcl_modules functions_and_macros list_inferred_types predef_symbols hash_table modtimefunction files error io out tcl_file heaps
// # files = trace_n ("Compiling "+++mod_ident.id_name) files
# (ok, mod, hash_table, error, predef_symbols, files)
= wantModule cWantIclFile mod_ident NoPos options.feo_generics(hash_table /* ---> ("Parsing:", mod_ident)*/) error search_paths predef_symbols files
= wantModule cWantIclFile mod_ident NoPos options.feo_generics(hash_table /* ---> ("Parsing:", mod_ident)*/) error search_paths predef_symbols modtimefunction files
| not ok
= (No,{},{},0,0,predef_symbols, hash_table, files, error, io, out, tcl_file, heaps)
# cached_module_idents = [dcl_mod.dcl_name \\ dcl_mod<-:cached_dcl_modules]
# (nr_of_chached_functions_and_macros, functions_and_macros) = usize functions_and_macros
# (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, predef_symbols, files)
= scanModule (mod -*-> "Scanning") cached_module_idents nr_of_chached_functions_and_macros options.feo_generics hash_table error search_paths predef_symbols files
= scanModule (mod -*-> "Scanning") cached_module_idents nr_of_chached_functions_and_macros options.feo_generics hash_table error search_paths predef_symbols modtimefunction files
/* JVG: */
// # hash_table = {hash_table & hte_entries={}}
# hash_table = remove_icl_symbols_from_hash_table hash_table
......@@ -275,11 +275,11 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules functions_an
// # (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}
#! fe ={ fe_icl =
# fe ={ fe_icl =
// {icl_mod & icl_functions=fun_defs }
{icl_functions=fun_defs,icl_instances=icl_instances,icl_specials=icl_specials,icl_common=icl_common,icl_import=icl_import,
icl_name=icl_name,icl_imported_objects=icl_imported_objects,icl_used_module_numbers=icl_used_module_numbers,
icl_copied_from_dcl=icl_copied_from_dcl}
icl_copied_from_dcl=icl_copied_from_dcl,icl_modification_time=icl_mod.icl_modification_time}
, fe_dcls = dcl_mods
, fe_components = components
......
......@@ -165,10 +165,14 @@ compileModule mod_name dcl_cache ms
dcl_cache = {dcl_cache & hash_table=hash_table}
= loadModule mod_ident.boxed_ident dcl_cache ms
dummyModTime :: {#Char} .f -> ({#Char}, .f)
dummyModTime _ f
= ("", f)
loadModule :: Ident *DclCache *MainState -> *(!Optional InterMod,!*DclCache,!*MainState);
loadModule mod_ident {dcl_modules,functions_and_macros,predef_symbols,hash_table,heaps} ms=:{ms_files,ms_error,ms_io,ms_out,ms_paths}
# (optional_syntax_tree,cached_functions_and_macros,cached_dcl_mods,_,main_dcl_module_n,predef_symbols, hash_table, ms_files, ms_error, ms_io, ms_out,_,heaps)
= frontEndInterface { feo_up_to_phase = FrontEndPhaseAll,feo_generics = False} mod_ident {sp_locations = [], sp_paths = ms_paths} dcl_modules functions_and_macros No predef_symbols hash_table ms_files ms_error ms_io ms_out No heaps
= frontEndInterface { feo_up_to_phase = FrontEndPhaseAll, feo_generics = False, feo_fusion = False} mod_ident {sp_locations = [], sp_paths = ms_paths} dcl_modules functions_and_macros No predef_symbols hash_table dummyModTime ms_files ms_error ms_io ms_out No heaps
# ms = {ms & ms_files=ms_files, ms_error=ms_error,ms_io=ms_io,ms_out=ms_out}
= case optional_syntax_tree of
Yes {fe_icl={/*icl_functions,*/icl_used_module_numbers}, fe_dcls, fe_dclIclConversions, fe_iclDclConversions}
......
......@@ -10,5 +10,5 @@ import syntax, hashtable, scanner, predef
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !Bool !Ident !Position !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
wantModule :: !Bool !Ident !Position !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols (ModTimeFunction *Files) !*Files
-> (!Bool, !ParsedModule, !*HashTable, !*File, !*PredefinedSymbols, !*Files)
......@@ -289,23 +289,23 @@ isClassOrInstanceDefsContext context :== context bitand cClassOrInstanceDefsCont
cWantIclFile :== True
cWantDclFile :== False
wantModule :: !Bool !Ident !Position !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
wantModule :: !Bool !Ident !Position !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols (ModTimeFunction *Files) !*Files
-> (!Bool, !ParsedModule, !*HashTable, !*File, !*PredefinedSymbols, !*Files)
wantModule iclmodule file_id=:{id_name} import_file_position support_generics hash_table error searchPaths pre_def_symbols files
= case openScanner file_name searchPaths files of
(Yes scanState, files)
wantModule iclmodule file_id=:{id_name} import_file_position support_generics hash_table error searchPaths pre_def_symbols modtimefunction files
= case openScanner file_name searchPaths modtimefunction files of
(Yes (scanState, modification_time), files)
# hash_table=set_hte_mark (if iclmodule 1 0) hash_table
# (ok,mod,hash_table,file,pre_def_symbols,files) = initModule file_name scanState hash_table error pre_def_symbols files
# (ok,mod,hash_table,file,pre_def_symbols,files) = initModule file_name modification_time scanState hash_table error pre_def_symbols files
# hash_table=set_hte_mark 0 hash_table
->(ok,mod,hash_table,file,pre_def_symbols,files)
(No, files)
-> let mod = { mod_name = file_id, mod_type = MK_None, mod_imports = [], mod_imported_objects = [], mod_defs = [] } in
-> let mod = { mod_name = file_id, mod_modification_time = "", mod_type = MK_None, mod_imports = [], mod_imported_objects = [], mod_defs = [] } in
(False, mod, hash_table, error <<< "Error " <<< import_file_position <<< ": " <<< file_name <<< " could not be imported\n", pre_def_symbols, files)
where
file_name = if iclmodule (id_name +++ ".icl") (id_name +++ ".dcl")
initModule :: String ScanState !*HashTable !*File !*PredefinedSymbols *Files
initModule :: String String ScanState !*HashTable !*File !*PredefinedSymbols *Files
-> (!Bool, !ParsedModule, !*HashTable, !*File, !*PredefinedSymbols, !*Files)
initModule file_name scanState hash_table error pre_def_symbols files
initModule file_name modification_time scanState hash_table error pre_def_symbols files
# (succ, mod_type, mod_name, scanState) = try_module_header iclmodule scanState
| succ
# pState = { ps_scanState = scanState
......@@ -327,7 +327,7 @@ where
defs = if (ParseOnly && id_name <> "StdOverloaded" && id_name <> "StdArray" && id_name <> "StdEnum" && id_name <> "StdBool" && id_name <> "StdDynamics" && id_name <> "StdGeneric")
[PD_Import imports \\ PD_Import imports <- defs]
defs
mod = { mod_name = mod_ident, mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs = defs }
mod = { mod_name = mod_ident, mod_modification_time = modification_time, mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs = defs }
= ( ps_error.pea_ok
, mod, ps_hash_table
, ps_error.pea_file
......@@ -336,7 +336,7 @@ where
)
// otherwise // ~ succ
# ({fp_line}, scanState) = getPosition scanState
mod = { mod_name = file_id, mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs = [] }
mod = { mod_name = file_id, mod_modification_time = modification_time, mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs = [] }
= (False, mod, hash_table, error <<< "Error [" <<< file_name <<< ',' <<< fp_line <<< "]: incorrect module header",
pre_def_symbols, closeScanner scanState files)
where
......
......@@ -4,5 +4,5 @@ import StdEnv
import syntax, parse, predef
scanModule :: !ParsedModule ![Ident] !Int !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
scanModule :: !ParsedModule ![Ident] !Int !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols (ModTimeFunction *Files) !*Files
-> (!Bool, !ScannedModule, !IndexRange, ![FunDef], !Optional ScannedModule, ![ScannedModule],!Int,!Int,!*HashTable, !*File, !*PredefinedSymbols, !*Files)
......@@ -1002,25 +1002,25 @@ transformArrayDenot exprs pi
[{bind_dst=toParsedExpr i pi, bind_src=expr} \\ expr <- exprs & i <- [0..]]
pi
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths Bool *Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths support_generics files ca
scanModules :: [ParsedImport] [ScannedModule] [Ident] SearchPaths Bool (ModTimeFunction *Files) *Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scanModules [] parsed_modules cached_modules searchPaths support_generics _ files ca
= (True, parsed_modules, files, ca)
scanModules [{import_module,import_symbols,import_file_position} : mods] parsed_modules cached_modules searchPaths support_generics files ca
scanModules [{import_module,import_symbols,import_file_position} : mods] parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
| in_cache import_module cached_modules
= scanModules mods parsed_modules cached_modules searchPaths support_generics files ca
= scanModules mods parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
# (found_module,mod_type) = try_to_find import_module parsed_modules
| found_module
= case mod_type of
MK_NoMainDcl
# ca = postParseError import_file_position ("main module \'"+++import_module.id_name+++"\' does not have a definition module") ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths support_generics files ca
# (_,parsed_modules,files,ca) = scanModules mods parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
-> (False,parsed_modules,files,ca)
_
-> scanModules mods parsed_modules cached_modules searchPaths support_generics files ca
-> scanModules mods parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
# (succ, parsed_modules, files, ca)
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths support_generics files ca
= parseAndScanDclModule import_module import_file_position parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
(mods_succ, parsed_modules, files, ca)
= scanModules mods parsed_modules cached_modules searchPaths support_generics files ca
= scanModules mods parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
= (succ && mods_succ, parsed_modules, files, ca)
where
in_cache mod_id []
......@@ -1039,26 +1039,26 @@ where
= try_to_find mod_id pmods
MakeEmptyModule name mod_type
:== { mod_name = name, mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs =
:== { mod_name = name, mod_modification_time = "", mod_type = mod_type, mod_imports = [], mod_imported_objects = [], mod_defs =
{ def_types = [], def_constructors = [], def_selectors = [], def_classes = [], def_macros = { ir_from = 0, ir_to = 0 },
def_members = [], def_funtypes = [], def_instances = [], /* AA */ def_generics = [] } }
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths !Bool !*Files !*CollectAdmin
parseAndScanDclModule :: !Ident !Position ![ScannedModule] ![Ident] !SearchPaths !Bool (ModTimeFunction *Files) !*Files !*CollectAdmin
-> *(!Bool, ![ScannedModule], !*Files, !*CollectAdmin)
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths support_generics files ca
parseAndScanDclModule dcl_module import_file_position parsed_modules cached_modules searchPaths support_generics modtimefunction files ca
# {ca_error, ca_fun_count, ca_rev_fun_defs, ca_predefs, ca_u_predefs, ca_hash_table}
= ca
hash_table = ca_hash_table
pea_file = ca_error.pea_file
predefs = ca_u_predefs
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile dcl_module import_file_position support_generics hash_table pea_file searchPaths predefs files
# (parse_ok, mod, hash_table, err_file, predefs, files) = wantModule cWantDclFile dcl_module import_file_position support_generics hash_table pea_file searchPaths predefs modtimefunction files
# ca = {ca_hash_table=hash_table, ca_error={pea_file=err_file,pea_ok=True}, ca_u_predefs=predefs, ca_fun_count=ca_fun_count, ca_rev_fun_defs=ca_rev_fun_defs, ca_predefs=ca_predefs}
| parse_ok
= scan_dcl_module mod parsed_modules searchPaths files ca
= scan_dcl_module mod parsed_modules searchPaths modtimefunction files ca
= (False, [MakeEmptyModule mod.mod_name MK_None: parsed_modules], files, ca)
where
scan_dcl_module :: ParsedModule [ScannedModule] !SearchPaths *Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scan_dcl_module mod=:{mod_defs = pdefs} parsed_modules searchPaths files ca
scan_dcl_module :: ParsedModule [ScannedModule] !SearchPaths (ModTimeFunction *Files) *Files *CollectAdmin -> (Bool, [ScannedModule], *Files, *CollectAdmin)
scan_dcl_module mod=:{mod_defs = pdefs} parsed_modules searchPaths modtimefunction files ca
# (_, defs, imports, imported_objects, ca)
= reorganiseDefinitions False pdefs 0 0 0 0 ca
(macro_defs, ca)
......@@ -1070,12 +1070,12 @@ where
mod
= { mod & mod_imports = imports, mod_imported_objects = imported_objects, mod_defs = { defs & def_macros = range }}
(import_ok, parsed_modules, files, ca)
= scanModules imports [mod : parsed_modules] cached_modules searchPaths support_generics files ca
= scanModules imports [mod : parsed_modules] cached_modules searchPaths support_generics modtimefunction files ca
= (pea_ok && import_ok, parsed_modules, files, ca)
scanModule :: !ParsedModule ![Ident] !Int !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols !*Files
scanModule :: !ParsedModule ![Ident] !Int !Bool !*HashTable !*File !SearchPaths !*PredefinedSymbols (ModTimeFunction *Files) !*Files
-> (!Bool, !ScannedModule, !IndexRange, ![FunDef], !Optional ScannedModule, ![ScannedModule],!Int,!Int,!*HashTable, !*File, !*PredefinedSymbols, !*Files)