diff options
-rw-r--r-- | backend/backend.dcl | 4 | ||||
-rw-r--r-- | backend/backend.icl | 4 | ||||
-rw-r--r-- | backend/backendconvert.icl | 22 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/backend.c | 15 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/backend.h | 4 | ||||
-rw-r--r-- | coclmaindll/backend.dll | bin | 1415616 -> 1430912 bytes | |||
-rw-r--r-- | frontend/check.icl | 4 | ||||
-rw-r--r-- | frontend/checksupport.dcl | 4 | ||||
-rw-r--r-- | frontend/checksupport.icl | 4 |
9 files changed, 43 insertions, 18 deletions
diff --git a/backend/backend.dcl b/backend/backend.dcl index aa3e18d..3ed50f3 100644 --- a/backend/backend.dcl +++ b/backend/backend.dcl @@ -247,9 +247,9 @@ BEDeclareDynamicTypeSymbol :: !Int !Int !BackEnd -> BackEnd; // void BEDeclareDynamicTypeSymbol (int typeIndex,int moduleIndex); BEDynamicTempTypeSymbol :: !BackEnd -> (!BESymbolP,!BackEnd); // BESymbolP BEDynamicTempTypeSymbol (); -kBEVersionCurrent:==0x02000208; +kBEVersionCurrent:==0x02000209; kBEVersionOldestDefinition:==0x02000204; -kBEVersionOldestImplementation:==0x02000208; +kBEVersionOldestImplementation:==0x02000209; kBEDebug:==1; kPredefinedModuleIndex:==1; BENoAnnot:==0; diff --git a/backend/backend.icl b/backend/backend.icl index 6fd12cc..3381d4a 100644 --- a/backend/backend.icl +++ b/backend/backend.icl @@ -671,9 +671,9 @@ BEDynamicTempTypeSymbol a0 = code { ccall BEDynamicTempTypeSymbol ":I:I" }; // BESymbolP BEDynamicTempTypeSymbol (); -kBEVersionCurrent:==0x02000208; +kBEVersionCurrent:==0x02000209; kBEVersionOldestDefinition:==0x02000204; -kBEVersionOldestImplementation:==0x02000208; +kBEVersionOldestImplementation:==0x02000209; kBEDebug:==1; kPredefinedModuleIndex:==1; BENoAnnot:==0; diff --git a/backend/backendconvert.icl b/backend/backendconvert.icl index a7f4f07..4cccf9b 100644 --- a/backend/backendconvert.icl +++ b/backend/backendconvert.icl @@ -464,13 +464,23 @@ where // otherwise = defineDclModule varHeap moduleIndex dclModule +isSystem :: ModuleKind -> Bool +isSystem MK_System + = True +isSystem MK_Module + = False +isSystem _ + = abort "backendconvert:isSystem, unknown module kind" + declareCurrentDclModule :: IclModule DclModule Int -> BackEnder -declareCurrentDclModule {icl_common} {dcl_name, dcl_functions, dcl_is_system, dcl_common} main_dcl_module_n - = appBackEnd (BEDeclareDclModule main_dcl_module_n dcl_name.id_name dcl_is_system (size dcl_functions) (size icl_common.com_type_defs) (size dcl_common.com_cons_defs) (size dcl_common.com_selector_defs)) - +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)) + declareDclModule :: ModuleIndex DclModule -> BackEnder -declareDclModule moduleIndex {dcl_name, dcl_common, dcl_functions, dcl_is_system} - = appBackEnd (BEDeclareDclModule moduleIndex dcl_name.id_name dcl_is_system (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_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)) /* defineCurrentDclModule :: VarHeap IclModule DclModule {#Int} -> BackEnder defineCurrentDclModule varHeap {icl_common} {dcl_name, dcl_common, dcl_functions, dcl_is_system, dcl_conversions} typeConversions @@ -478,7 +488,7 @@ defineCurrentDclModule varHeap {icl_common} {dcl_name, dcl_common, dcl_functions o` defineCurrentDclModuleTypes dcl_common.com_cons_defs dcl_common.com_selector_defs dcl_common.com_type_defs typeConversions varHeap */ defineDclModule :: VarHeap ModuleIndex DclModule -> BackEnder -defineDclModule varHeap moduleIndex {dcl_name, dcl_common, dcl_functions, dcl_is_system,dcl_instances} +defineDclModule varHeap moduleIndex {dcl_name, dcl_common, dcl_functions,dcl_instances} = declare moduleIndex varHeap dcl_common o` declareFunTypes moduleIndex dcl_functions dcl_instances.ir_from varHeap diff --git a/backendC/CleanCompilerSources/backend.c b/backendC/CleanCompilerSources/backend.c index d830ccc..726cfd6 100644 --- a/backendC/CleanCompilerSources/backend.c +++ b/backendC/CleanCompilerSources/backend.c @@ -370,9 +370,11 @@ BEDeclareIclModule (CleanString name, int nFunctions, int nTypes, int nConstruct ImpMod iclModule; BEIclP icl; -/* cName = ConvertCleanString (name); */ cName = gBEState.be_modules [main_dcl_module_n].bem_name; + if (cName == NULL) + cName = ConvertCleanString (name); + moduleNameSymbol = ConvertAllocType (SymbolS); moduleNameSymbol->symb_ident = Identifier (cName); @@ -449,9 +451,9 @@ BEDeclareDclModule (int moduleIndex, CleanString name, int isSystemModule, int n dclModule->dm_system_module = isSystemModule; dclModule->dm_symbols = gBEState.be_allSymbols; /* ??? too many symbols? */ - if (moduleIndex != main_dcl_module_n) - AddOpenDefinitionModule (moduleNameSymbol, dclModule); - else + AddOpenDefinitionModule (moduleNameSymbol, dclModule); + + if (moduleIndex == main_dcl_module_n) gBEState.be_allSymbols = saveSymbols; } /* BEDeclareDclModule */ @@ -468,10 +470,15 @@ BEDeclarePredefinedModule (int nTypes, int nConstructors) void BEDeclareModules (int nModules) { + int i; + Assert (gBEState.be_modules == NULL); gBEState.be_nModules = (unsigned int) nModules; gBEState.be_modules = (BEModuleP) ConvertAlloc (nModules * sizeof (BEModuleS)); + + for (i = 0; i < nModules; i++) + gBEState.be_modules [i].bem_name = NULL; } /* BEDeclareModules */ BESymbolP diff --git a/backendC/CleanCompilerSources/backend.h b/backendC/CleanCompilerSources/backend.h index 0411868..2198250 100644 --- a/backendC/CleanCompilerSources/backend.h +++ b/backendC/CleanCompilerSources/backend.h @@ -1,7 +1,7 @@ /* version info */ // increment this for every release -# define kBEVersionCurrent 0x02000208 +# define kBEVersionCurrent 0x02000209 // change this to the same value as kBEVersionCurrent if the new release is not // upward compatible (for example when a function is added) @@ -9,7 +9,7 @@ // 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 0x02000208 +# define kBEVersionOldestImplementation 0x02000209 # define kBEDebug 1 diff --git a/coclmaindll/backend.dll b/coclmaindll/backend.dll Binary files differindex 2662f5e..ddd3272 100644 --- a/coclmaindll/backend.dll +++ b/coclmaindll/backend.dll diff --git a/frontend/check.icl b/frontend/check.icl index c1502e3..0a36f56 100644 --- a/frontend/check.icl +++ b/frontend/check.icl @@ -2169,9 +2169,13 @@ initialDclModule ({mod_name, mod_defs=mod_defs=:{def_funtypes,def_macros}, mod_t , dcls_local_for_import = {local_declaration_for_import decl module_n \\ decl<-all_defs} } , dcl_conversions = No +/* RWS ... , dcl_is_system = case mod_type of MK_System -> True _ -> False +*/ + , dcl_module_kind = mod_type +// ... RWS , dcl_imported_module_numbers = EndNumbers , dcl_is_cashed = False } diff --git a/frontend/checksupport.dcl b/frontend/checksupport.dcl index 322819c..ff4d68f 100644 --- a/frontend/checksupport.dcl +++ b/frontend/checksupport.dcl @@ -105,7 +105,9 @@ cConversionTableSize :== 9 // AA , dcl_sizes :: !{# Int} , dcl_declared :: !Declarations , dcl_conversions :: !Optional ConversionTable - , dcl_is_system :: !Bool +// RWS ... , dcl_is_system :: !Bool + , dcl_module_kind :: !ModuleKind +// ... RWS , dcl_imported_module_numbers :: !NumberSet , dcl_is_cashed :: !Bool } diff --git a/frontend/checksupport.icl b/frontend/checksupport.icl index 0222299..bdb6c16 100644 --- a/frontend/checksupport.icl +++ b/frontend/checksupport.icl @@ -118,7 +118,9 @@ where , dcl_sizes :: !{# Int} , dcl_declared :: !Declarations , dcl_conversions :: !Optional ConversionTable - , dcl_is_system :: !Bool +// RWS ... , dcl_is_system :: !Bool + , dcl_module_kind :: !ModuleKind +// ... RWS , dcl_imported_module_numbers :: !NumberSet , dcl_is_cashed :: !Bool } |