Commit e0a67dd4 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

remove symb_next, store function types of definition modules in...

remove symb_next, store function types of definition modules in mfts_function_symbol_a, store SpecialArrayFunctionSymbols in sdef_special_array_function_symbol instead of symb_next, remove ExitOnInterrupt calls
parent d8947577
...@@ -118,7 +118,6 @@ STRUCT (be_state, BEState) ...@@ -118,7 +118,6 @@ STRUCT (be_state, BEState)
BEIclS be_icl; BEIclS be_icl;
unsigned int be_nModules; unsigned int be_nModules;
SymbolP be_function_symbols;
SymbolP be_dontCareSymbol; SymbolP be_dontCareSymbol;
SymbolP be_dictionarySelectFunSymbol; SymbolP be_dictionarySelectFunSymbol;
SymbolP be_dictionaryUpdateFunSymbol; SymbolP be_dictionaryUpdateFunSymbol;
...@@ -176,32 +175,15 @@ PredefinedSymbol (SymbKind symbolKind, int arity) ...@@ -176,32 +175,15 @@ PredefinedSymbol (SymbKind symbolKind, int arity)
} /* PredefinedSymbol */ } /* PredefinedSymbol */
static SymbolP static SymbolP
AllocateSymbols (int nFunctions, int nTypesConstructorsAndFields, SymbolP *function_symbols_h) AllocateSymbols (int n_symbols)
{ {
int nSymbols; if (n_symbols!=0){
nSymbols = nFunctions+nTypesConstructorsAndFields;
if (nSymbols!=0){
SymbolP symbols; SymbolP symbols;
int i; int i;
symbols = (SymbolP) ConvertAlloc (nSymbols * sizeof (SymbolS)); symbols = (SymbolP) ConvertAlloc (n_symbols * sizeof (SymbolS));
i = 0; for (i = 0; i < n_symbols; i++)
if (nFunctions>0){
for (; i < nFunctions; ++i){
symbols [i].symb_kind = erroneous_symb;
symbols [i].symb_next = &symbols [i+1];
}
symbols [nFunctions-1].symb_next = *function_symbols_h;
*function_symbols_h = symbols;
}
for (; i < nSymbols; i++){
symbols [i].symb_kind = erroneous_symb; symbols [i].symb_kind = erroneous_symb;
symbols [i].symb_next = NULL;
}
return symbols; return symbols;
} else } else
...@@ -277,13 +259,12 @@ NewGuardNode (NodeP ifNode, NodeP node, NodeDefP nodeDefs, StrictNodeIdP stricts ...@@ -277,13 +259,12 @@ NewGuardNode (NodeP ifNode, NodeP node, NodeDefP nodeDefs, StrictNodeIdP stricts
} /* NewGuardNode */ } /* NewGuardNode */
static void static void
DeclareModule (int moduleIndex, char *name, Bool isSystemModule, int nFunctions, DeclareModule (int moduleIndex, char *name, Bool isSystemModule, int nFunctions,int nTypes, int nConstructors, int nFields)
int nTypes, int nConstructors, int nFields)
{ {
SymbolP symbols;
BEModuleP module; BEModuleP module;
SymbolP symbols;
symbols = AllocateSymbols (nFunctions, nTypes + nConstructors + nFields, &gBEState.be_function_symbols); symbols = AllocateSymbols (nFunctions + nTypes + nConstructors + nFields);
Assert ((unsigned int) moduleIndex < gBEState.be_nModules); Assert ((unsigned int) moduleIndex < gBEState.be_nModules);
module = &gBEState.be_modules [moduleIndex]; module = &gBEState.be_modules [moduleIndex];
...@@ -359,11 +340,11 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio ...@@ -359,11 +340,11 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
icl->beicl_depsP = &scc_dependency_list; icl->beicl_depsP = &scc_dependency_list;
{ {
struct module_type_symbols *dcl_type_symbols_a; struct module_function_and_type_symbols *dcl_type_symbols_a;
int n_dcl_type_symbols; int n_dcl_type_symbols;
struct def_list *def_mod; struct def_list *def_mod;
dcl_type_symbols_a = (struct module_type_symbols*) ConvertAlloc (gBEState.be_nModules * sizeof (struct module_type_symbols)); dcl_type_symbols_a = (struct module_function_and_type_symbols*) ConvertAlloc (gBEState.be_nModules * sizeof (struct module_function_and_type_symbols));
n_dcl_type_symbols=0; n_dcl_type_symbols=0;
for (def_mod=OpenDefinitionModules; def_mod!=NULL; def_mod=def_mod->mod_next){ for (def_mod=OpenDefinitionModules; def_mod!=NULL; def_mod=def_mod->mod_next){
...@@ -371,23 +352,28 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio ...@@ -371,23 +352,28 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
module_n = def_mod->mod_body->dm_module_n; module_n = def_mod->mod_body->dm_module_n;
if (module_n!=main_dcl_module_n){ if (module_n!=main_dcl_module_n){
dcl_type_symbols_a[n_dcl_type_symbols].mts_n_types = gBEState.be_modules [module_n].bem_nTypes; dcl_type_symbols_a[n_dcl_type_symbols].mfts_n_types = gBEState.be_modules[module_n].bem_nTypes;
dcl_type_symbols_a[n_dcl_type_symbols].mts_type_symbol_a = gBEState.be_modules [module_n].bem_types; dcl_type_symbols_a[n_dcl_type_symbols].mfts_type_symbol_a = gBEState.be_modules[module_n].bem_types;
dcl_type_symbols_a[n_dcl_type_symbols].mfts_n_functions = gBEState.be_modules[module_n].bem_nFunctions;
dcl_type_symbols_a[n_dcl_type_symbols].mfts_function_symbol_a = gBEState.be_modules[module_n].bem_functions;
++n_dcl_type_symbols; ++n_dcl_type_symbols;
} }
} }
dcl_type_symbols_a[n_dcl_type_symbols].mts_n_types = gBEState.be_modules [kPredefinedModuleIndex].bem_nTypes; dcl_type_symbols_a[n_dcl_type_symbols].mfts_n_types = gBEState.be_modules[kPredefinedModuleIndex].bem_nTypes;
dcl_type_symbols_a[n_dcl_type_symbols].mts_type_symbol_a = gBEState.be_modules [kPredefinedModuleIndex].bem_types; dcl_type_symbols_a[n_dcl_type_symbols].mfts_type_symbol_a = gBEState.be_modules[kPredefinedModuleIndex].bem_types;
dcl_type_symbols_a[n_dcl_type_symbols].mfts_n_functions = gBEState.be_modules[kPredefinedModuleIndex].bem_nFunctions;
dcl_type_symbols_a[n_dcl_type_symbols].mfts_function_symbol_a = gBEState.be_modules[kPredefinedModuleIndex].bem_functions;
++n_dcl_type_symbols; ++n_dcl_type_symbols;
Assert (n_dcl_type_symbols<=gBEState.be_nModules); Assert (n_dcl_type_symbols<=gBEState.be_nModules);
icl->beicl_module->im_dcl_type_symbols_a = dcl_type_symbols_a; icl->beicl_module->im_dcl_mfts_a = dcl_type_symbols_a;
icl->beicl_module->im_size_dcl_type_symbols_a = n_dcl_type_symbols; icl->beicl_module->im_size_dcl_mfts_a = n_dcl_type_symbols;
} }
nFunctions += ArraySize (gLocallyGeneratedFunctions); nFunctions += ArraySize (gLocallyGeneratedFunctions);
DeclareModule (main_dcl_module_n, cName, False, nFunctions, nTypes, nConstructors, nFields); DeclareModule (main_dcl_module_n, cName, False, nFunctions, nTypes, nConstructors, nFields);
iclModule = icl->beicl_module; iclModule = icl->beicl_module;
...@@ -396,9 +382,10 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio ...@@ -396,9 +382,10 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
iclModule->im_def_module = im_def_module; iclModule->im_def_module = im_def_module;
iclModule->im_rules = NULL; iclModule->im_rules = NULL;
iclModule->im_start = NULL; iclModule->im_start = NULL;
iclModule->im_type_symbols.mts_n_types = nTypes; iclModule->im_mfts_a.mfts_n_types = nTypes;
iclModule->im_type_symbols.mts_type_symbol_a = gBEState.be_modules [main_dcl_module_n].bem_types; iclModule->im_mfts_a.mfts_type_symbol_a = gBEState.be_modules [main_dcl_module_n].bem_types;
iclModule->im_function_symbols = gBEState.be_function_symbols; iclModule->im_mfts_a.mfts_n_functions = nFunctions;
iclModule->im_mfts_a.mfts_function_symbol_a = gBEState.be_modules[main_dcl_module_n].bem_functions;
# if IMPORT_OBJ_AND_LIB # if IMPORT_OBJ_AND_LIB
iclModule->im_imported_objs = NULL; iclModule->im_imported_objs = NULL;
iclModule->im_imported_libs = NULL; iclModule->im_imported_libs = NULL;
...@@ -429,20 +416,12 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT ...@@ -429,20 +416,12 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT
char *cName; char *cName;
SymbolP moduleNameSymbol; SymbolP moduleNameSymbol;
DefMod dclModule; DefMod dclModule;
SymbolP saved_function_symbols,previous_all_symbols;
cName = ConvertCleanString (name); cName = ConvertCleanString (name);
moduleNameSymbol = ConvertAllocType (SymbolS); moduleNameSymbol = ConvertAllocType (SymbolS);
moduleNameSymbol->symb_ident = Identifier (cName); moduleNameSymbol->symb_ident = Identifier (cName);
if (moduleIndex == main_dcl_module_n){
saved_function_symbols = gBEState.be_function_symbols;
gBEState.be_function_symbols = NULL;
}
previous_all_symbols = gBEState.be_function_symbols;
DeclareModule (moduleIndex, cName, isSystemModule, nFunctions, nTypes, nConstructors, nFields); DeclareModule (moduleIndex, cName, isSystemModule, nFunctions, nTypes, nConstructors, nFields);
dclModule = ConvertAllocType (DefRepr); dclModule = ConvertAllocType (DefRepr);
...@@ -450,16 +429,11 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT ...@@ -450,16 +429,11 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT
dclModule->dm_module_n = moduleIndex; dclModule->dm_module_n = moduleIndex;
dclModule->dm_modification_time = ConvertCleanString (modificationTime); dclModule->dm_modification_time = ConvertCleanString (modificationTime);
dclModule->dm_system_module = isSystemModule; dclModule->dm_system_module = isSystemModule;
dclModule->dm_function_symbols = gBEState.be_function_symbols; dclModule->dm_function_symbol_a = gBEState.be_modules[moduleIndex].bem_functions;
dclModule->dm_symbols_end = previous_all_symbols; dclModule->dm_n_function_symbols = gBEState.be_modules[moduleIndex].bem_nFunctions;
dclModule->dm_system_module_table_kind = FirstSystemModuleTable + moduleIndex; dclModule->dm_system_module_table_kind = FirstSystemModuleTable + moduleIndex;
AddOpenDefinitionModule (moduleNameSymbol, dclModule); AddOpenDefinitionModule (moduleNameSymbol, dclModule);
if (moduleIndex == main_dcl_module_n){
gBEState.be_function_symbols = saved_function_symbols;
im_def_module=dclModule;
}
} /* BEDeclareDclModule */ } /* BEDeclareDclModule */
void void
...@@ -564,10 +538,11 @@ BESymbolP ...@@ -564,10 +538,11 @@ BESymbolP
BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, int moduleIndex) BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, int moduleIndex)
{ {
BEModuleP module; BEModuleP module;
SymbolP functionSymbol,previousFunctionSymbol; SymbolP functionSymbol;
SymbDefP originalsdef; SymbDefP originalsdef;
TypeAlt *typeAlt; TypeAlt *typeAlt;
TypeNode elementType, arrayType; TypeNode elementType, arrayType;
SymbDef previousFunctionSymbDef;
Assert ((unsigned int) moduleIndex < gBEState.be_nModules); Assert ((unsigned int) moduleIndex < gBEState.be_nModules);
module = &gBEState.be_modules [moduleIndex]; module = &gBEState.be_modules [moduleIndex];
...@@ -599,21 +574,18 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in ...@@ -599,21 +574,18 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
return (functionSymbol); return (functionSymbol);
} }
previousFunctionSymbol = functionSymbol; previousFunctionSymbDef = originalsdef;
functionSymbol = functionSymbol->symb_next; if (previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION){
functionSymbol = previousFunctionSymbDef->sdef_special_array_function_symbol;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition){
if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind) if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
return functionSymbol; return functionSymbol;
if (arrayFunKind == BE_UnqArraySelectLastFun && functionSymbol->symb_def->sdef_arfun == BE_UnqArraySelectFun){ if (arrayFunKind == BE_UnqArraySelectLastFun && functionSymbol->symb_def->sdef_arfun == BE_UnqArraySelectFun){
previousFunctionSymbol = functionSymbol; previousFunctionSymbDef = functionSymbol->symb_def;
functionSymbol = functionSymbol->symb_next; if (previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION){
functionSymbol = previousFunctionSymbDef->sdef_special_array_function_symbol;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition && if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind) return functionSymbol;
{
return functionSymbol;
} }
} }
} }
...@@ -720,9 +692,14 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in ...@@ -720,9 +692,14 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
newFunctionSymbol->symb_kind = definition; newFunctionSymbol->symb_kind = definition;
newFunctionSymbol->symb_def = newsdef; newFunctionSymbol->symb_def = newsdef;
functionSymbol = previousFunctionSymbol->symb_next; if ((previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION)==0){
previousFunctionSymbol->symb_next = newFunctionSymbol; previousFunctionSymbDef->sdef_special_array_function_symbol = newFunctionSymbol;
newFunctionSymbol->symb_next = functionSymbol; previousFunctionSymbDef->sdef_mark |= SDEF_HAS_SPECIAL_ARRAY_FUNCTION;
} else {
newsdef->sdef_special_array_function_symbol = previousFunctionSymbDef->sdef_special_array_function_symbol;
newsdef->sdef_mark |= SDEF_HAS_SPECIAL_ARRAY_FUNCTION;
previousFunctionSymbDef->sdef_special_array_function_symbol = newFunctionSymbol;
}
AddUserDefinedArrayFunction (newFunctionSymbol); AddUserDefinedArrayFunction (newFunctionSymbol);
...@@ -3281,14 +3258,12 @@ static void init_unboxed_list_symbols (void) ...@@ -3281,14 +3258,12 @@ static void init_unboxed_list_symbols (void)
symbol_p->symb_head_strictness=4; symbol_p->symb_head_strictness=4;
symbol_p->symb_tail_strictness=0; symbol_p->symb_tail_strictness=0;
symbol_p->symb_state_p=&BasicSymbolStates[i]; symbol_p->symb_state_p=&BasicSymbolStates[i];
symbol_p->symb_next=NULL;
symbol_p=&unboxed_list_symbols[i][1]; symbol_p=&unboxed_list_symbols[i][1];
symbol_p->symb_kind=cons_symb; symbol_p->symb_kind=cons_symb;
symbol_p->symb_head_strictness=4; symbol_p->symb_head_strictness=4;
symbol_p->symb_tail_strictness=1; symbol_p->symb_tail_strictness=1;
symbol_p->symb_state_p=&BasicSymbolStates[i]; symbol_p->symb_state_p=&BasicSymbolStates[i];
symbol_p->symb_next=NULL;
} }
array_state_p=ConvertAllocType (StateS); array_state_p=ConvertAllocType (StateS);
...@@ -3398,7 +3373,6 @@ BEInit (int argc) ...@@ -3398,7 +3373,6 @@ BEInit (int argc)
gBEState.be_argi = 0; gBEState.be_argi = 0;
gBEState.be_modules = NULL; gBEState.be_modules = NULL;
gBEState.be_function_symbols = NULL;
gBEState.be_dontCareSymbol = NULL; gBEState.be_dontCareSymbol = NULL;
gBEState.be_dictionarySelectFunSymbol = NULL; gBEState.be_dictionarySelectFunSymbol = NULL;
gBEState.be_dictionaryUpdateFunSymbol = NULL; gBEState.be_dictionaryUpdateFunSymbol = NULL;
......
...@@ -51,20 +51,21 @@ void ReadInlineCode (void) ...@@ -51,20 +51,21 @@ void ReadInlineCode (void)
def_mod=d_mod->mod_body; def_mod=d_mod->mod_body;
if (def_mod->dm_system_module){ if (def_mod->dm_system_module){
Symbol symbol,symbols_end; int i,n_function_symbols;
Symbol function_symbol_a;
symbols_end=def_mod->dm_symbols_end; n_function_symbols=def_mod->dm_n_function_symbols;
function_symbol_a=def_mod->dm_function_symbol_a;
for (symbol=def_mod->dm_function_symbols; symbol!=NULL && symbol!=symbols_end; symbol=symbol->symb_next) for (i=0; i<n_function_symbols; ++i)
if (symbol->symb_kind==definition){ if (function_symbol_a[i].symb_kind==definition){
SymbDef sdef; SymbDef sdef;
sdef=symbol->symb_def; sdef=function_symbol_a[i].symb_def;
if (sdef->sdef_kind==SYSRULE && sdef->sdef_mark & SDEF_USED_STRICTLY_MASK) if (sdef->sdef_kind==SYSRULE && sdef->sdef_mark & SDEF_USED_STRICTLY_MASK)
break; break;
} }
if (symbol!=NULL && symbol!=symbols_end && d_mod->mod_name->symb_ident->ident_name!=CurrentModule) if (i<n_function_symbols && d_mod->mod_name->symb_ident->ident_name!=CurrentModule)
/* Get the inline instructions of all the rules that are defined in this module */ /* Get the inline instructions of all the rules that are defined in this module */
ScanInlineFile (d_mod->mod_name->symb_ident->ident_name,def_mod->dm_system_module_table_kind); ScanInlineFile (d_mod->mod_name->symb_ident->ident_name,def_mod->dm_system_module_table_kind);
} }
......
...@@ -951,7 +951,7 @@ static void CodeRule (ImpRuleP rule) ...@@ -951,7 +951,7 @@ static void CodeRule (ImpRuleP rule)
break; break;
} }
} }
GenRtn (1,0,OnAState); GenRtn (1,0,OnAState);
} }
...@@ -1130,29 +1130,29 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1130,29 +1130,29 @@ void CodeGeneration (ImpMod imod, char *fname)
{ {
if (! CompilerError){ if (! CompilerError){
int DoStrictnessAnalysis_and_init_ok; int DoStrictnessAnalysis_and_init_ok;
ImpRuleP new_rules;
CurrentPhase = NULL; CurrentPhase = NULL;
#if 0 #if 0
PrintRules (imod->im_rules); PrintRules (imod->im_rules);
#endif #endif
DetermineSharedAndAnnotatedNodes (imod->im_rules,&imod->im_function_symbols);
ExitOnInterrupt(); new_rules=DetermineSharedAndAnnotatedNodes (imod->im_rules);
#if 0 #if 0
PrintRules (imod->im_rules,rules_file); PrintRules (imod->im_rules,rules_file);
#endif #endif
GenerateStatesForRecords (imod->im_type_symbols,imod->im_size_dcl_type_symbols_a,imod->im_dcl_type_symbols_a); GenerateStatesForRecords (imod->im_mfts_a,imod->im_size_dcl_mfts_a,imod->im_dcl_mfts_a);
DoStrictnessAnalysis_and_init_ok = DoStrictnessAnalysis && init_strictness_analysis (imod); DoStrictnessAnalysis_and_init_ok = DoStrictnessAnalysis && init_strictness_analysis (imod);
if (DoStrictnessAnalysis_and_init_ok){ if (DoStrictnessAnalysis_and_init_ok){
do_strictness_analysis(); do_strictness_analysis();
ExitOnInterrupt();
} }
ExamineTypesAndLhsOfSymbols (imod->im_function_symbols,imod->im_type_symbols,imod->im_size_dcl_type_symbols_a,imod->im_dcl_type_symbols_a); ExamineTypesAndLhsOfSymbols (imod->im_mfts_a,imod->im_size_dcl_mfts_a,imod->im_dcl_mfts_a,new_rules);
#ifdef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS #ifdef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
{ {
...@@ -1168,11 +1168,8 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1168,11 +1168,8 @@ void CodeGeneration (ImpMod imod, char *fname)
generate_states (imod->im_rules,True); generate_states (imod->im_rules,True);
if (DoStrictnessAnalysis_and_init_ok){ if (DoStrictnessAnalysis_and_init_ok){
ExitOnInterrupt();
finish_strictness_analysis(); finish_strictness_analysis();
} }
ExitOnInterrupt();
#if 0 #if 0
PrintRules (imod->im_rules); PrintRules (imod->im_rules);
...@@ -1181,7 +1178,6 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1181,7 +1178,6 @@ void CodeGeneration (ImpMod imod, char *fname)
optimise_strict_tuple_result_functions=0; optimise_strict_tuple_result_functions=0;
OptimiseRules (imod->im_rules,imod->im_start); OptimiseRules (imod->im_rules,imod->im_start);
ExitOnInterrupt();
#if 0 #if 0
PrintRules (imod->im_rules,rules_file); PrintRules (imod->im_rules,rules_file);
#endif #endif
...@@ -1228,21 +1224,19 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1228,21 +1224,19 @@ void CodeGeneration (ImpMod imod, char *fname)
#endif #endif
GenSystemImports(); GenSystemImports();
FileComment(); FileComment();
ExitOnInterrupt();
ReadInlineCode (); ReadInlineCode();
CreateStackFrames(); CreateStackFrames();
ImportSymbols (imod->im_function_symbols,imod->im_size_dcl_type_symbols_a,imod->im_dcl_type_symbols_a); ImportSymbols (imod->im_size_dcl_mfts_a,imod->im_dcl_mfts_a);
GenerateCodeForConstructorsAndRecords (imod->im_type_symbols); GenerateCodeForConstructorsAndRecords (imod->im_mfts_a);
GenerateForeignExports (imod->im_foreign_exports); GenerateForeignExports (imod->im_foreign_exports);
if (imod->im_start) if (imod->im_start)
GenStart (imod->im_start); GenStart (imod->im_start);
ExitOnInterrupt ();
#if SHARE_UPDATE_CODE #if SHARE_UPDATE_CODE
create_result_state_database (imod->im_rules); create_result_state_database (imod->im_rules);
...@@ -1275,8 +1269,6 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1275,8 +1269,6 @@ void CodeGeneration (ImpMod imod, char *fname)
} }
update_function_p=&first_update_function; update_function_p=&first_update_function;
} }
ExitOnInterrupt ();
} }
GenerateCodeForLazyTupleSelectorEntries (LazyTupleSelectors); GenerateCodeForLazyTupleSelectorEntries (LazyTupleSelectors);
...@@ -1285,7 +1277,7 @@ void CodeGeneration (ImpMod imod, char *fname) ...@@ -1285,7 +1277,7 @@ void CodeGeneration (ImpMod imod, char *fname)
GenerateCodeForLazyUnboxedRecordListFunctions(); GenerateCodeForLazyUnboxedRecordListFunctions();
#endif #endif
import_not_yet_imported_record_r_labels (imod->im_size_dcl_type_symbols_a,imod->im_dcl_type_symbols_a); import_not_yet_imported_record_r_labels (imod->im_size_dcl_mfts_a,imod->im_dcl_mfts_a);
import_not_yet_imported_system_labels(); import_not_yet_imported_system_labels();
WriteLastNewlineToABCFile(); WriteLastNewlineToABCFile();
......
...@@ -1603,7 +1603,7 @@ void GenerateCodeForLazyArrayFunctionEntries (void) ...@@ -1603,7 +1603,7 @@ void GenerateCodeForLazyArrayFunctionEntries (void)
} }
} }
void GenerateCodeForConstructorsAndRecords (struct module_type_symbols mts) void GenerateCodeForConstructorsAndRecords (struct module_function_and_type_symbols mfts)
{ {
int n_types,i; int n_types,i;
SymbolP type_symbol_a; SymbolP type_symbol_a;
...@@ -1611,8 +1611,8 @@ void GenerateCodeForConstructorsAndRecords (struct module_type_symbols mts) ...@@ -1611,8 +1611,8 @@ void GenerateCodeForConstructorsAndRecords (struct module_type_symbols mts)
PolyList unboxed_record_cons_element; PolyList unboxed_record_cons_element;
#endif #endif
n_types = mts.mts_n_types; n_types = mfts.mfts_n_types;
type_symbol_a = mts.mts_type_symbol_a; type_symbol_a = mfts.mfts_type_symbol_a;
for (i=0; i<n_types; ++i){ for (i=0; i<n_types; ++i){
if (type_symbol_a[i].symb_kind==definition){ if (type_symbol_a[i].symb_kind==definition){
SymbDef def; SymbDef def;
......
...@@ -91,7 +91,7 @@ extern void AddStateSizesAndMaxFrameSizes (int arity, States states,int *maxasiz ...@@ -91,7 +91,7 @@ extern void AddStateSizesAndMaxFrameSizes (int arity, States states,int *maxasiz
extern void AddStateSizesAndMaxFrameSizesOfArguments (Args args,int *maxasize, int *asize, int *bsize); extern void AddStateSizesAndMaxFrameSizesOfArguments (Args args,int *maxasize, int *asize, int *bsize);
extern void DetermineFieldSizeAndPosition (int fieldnr, int *asize, int *bsize,int *apos, int *bpos, States argstates); extern void DetermineFieldSizeAndPosition (int fieldnr, int *asize, int *bsize,int *apos, int *bpos, States argstates);
extern void GenerateCodeForConstructorsAndRecords (struct module_type_symbols mts); extern void GenerateCodeForConstructorsAndRecords (struct module_function_and_type_symbols mfts);
extern Bool NodeEntry (StateS *const function_state_p,int arity,Label ealab,SymbDef rootsymb); extern Bool NodeEntry (StateS *const function_state_p,int arity,Label ealab,SymbDef rootsymb);
extern Bool NodeEntryUnboxed (StateS *const function_state_p,NodeP call_node_p,int args_a_size,int args_b_size,Label ealab,SymbDef rootsymb); extern Bool NodeEntryUnboxed (StateS *const function_state_p,NodeP call_node_p,int args_a_size,int args_b_size,Label ealab,SymbDef rootsymb);
......
...@@ -467,32 +467,10 @@ void PrintVersion (void) ...@@ -467,32 +467,10 @@ void PrintVersion (void)
static char Init[] = "Compiler initialization"; static char Init[] = "Compiler initialization";
Bool InterruptFlag;
File OpenedFile; File OpenedFile;
static void SetInterruptFlag (void)
{
InterruptFlag = True;
}
void ExitOnInterrupt (void)
{
if (InterruptFlag){
if (OpenedFile){
if (ABCFileName){
CompilerError = True;
CloseABCFile (ABCFileName);
} else
FClose (OpenedFile);
OpenedFile = (File) NIL;
}
longjmp (ExitEnv, 1);
}
}
void InitCompiler (void) void InitCompiler (void)
{ {
InterruptFlag = False;
OpenedFile = (File) NIL; OpenedFile = (File) NIL;
CompilerError = False; CompilerError = False;