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

generate .depend for current dcl module

parent ae14d860
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
/* 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
......
No preview for this file type
......@@ -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
}
......
......@@ -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
}
......
......@@ -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
}
......
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