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)
BEIclS be_icl;
unsigned int be_nModules;
SymbolP be_function_symbols;
SymbolP be_dontCareSymbol;
SymbolP be_dictionarySelectFunSymbol;
SymbolP be_dictionaryUpdateFunSymbol;
......@@ -176,32 +175,15 @@ PredefinedSymbol (SymbKind symbolKind, int arity)
} /* PredefinedSymbol */
static SymbolP
AllocateSymbols (int nFunctions, int nTypesConstructorsAndFields, SymbolP *function_symbols_h)
{
int nSymbols;
nSymbols = nFunctions+nTypesConstructorsAndFields;
if (nSymbols!=0){
AllocateSymbols (int n_symbols)
{
if (n_symbols!=0){
SymbolP symbols;
int i;
symbols = (SymbolP) ConvertAlloc (nSymbols * sizeof (SymbolS));
i = 0;
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 = (SymbolP) ConvertAlloc (n_symbols * sizeof (SymbolS));
for (i = 0; i < n_symbols; i++)
symbols [i].symb_kind = erroneous_symb;
symbols [i].symb_next = NULL;
}
return symbols;
} else
......@@ -277,13 +259,12 @@ NewGuardNode (NodeP ifNode, NodeP node, NodeDefP nodeDefs, StrictNodeIdP stricts
} /* NewGuardNode */
static void
DeclareModule (int moduleIndex, char *name, Bool isSystemModule, int nFunctions,
int nTypes, int nConstructors, int nFields)
DeclareModule (int moduleIndex, char *name, Bool isSystemModule, int nFunctions,int nTypes, int nConstructors, int nFields)
{
SymbolP symbols;
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);
module = &gBEState.be_modules [moduleIndex];
......@@ -359,11 +340,11 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
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;
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;
for (def_mod=OpenDefinitionModules; def_mod!=NULL; def_mod=def_mod->mod_next){
......@@ -371,23 +352,28 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
module_n = def_mod->mod_body->dm_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].mts_type_symbol_a = gBEState.be_modules [module_n].bem_types;
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].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;
}
}
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].mts_type_symbol_a = gBEState.be_modules [kPredefinedModuleIndex].bem_types;
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].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;
Assert (n_dcl_type_symbols<=gBEState.be_nModules);
icl->beicl_module->im_dcl_type_symbols_a = dcl_type_symbols_a;
icl->beicl_module->im_size_dcl_type_symbols_a = n_dcl_type_symbols;
icl->beicl_module->im_dcl_mfts_a = dcl_type_symbols_a;
icl->beicl_module->im_size_dcl_mfts_a = n_dcl_type_symbols;
}
nFunctions += ArraySize (gLocallyGeneratedFunctions);
DeclareModule (main_dcl_module_n, cName, False, nFunctions, nTypes, nConstructors, nFields);
iclModule = icl->beicl_module;
......@@ -396,9 +382,10 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
iclModule->im_def_module = im_def_module;
iclModule->im_rules = NULL;
iclModule->im_start = NULL;
iclModule->im_type_symbols.mts_n_types = nTypes;
iclModule->im_type_symbols.mts_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_types = nTypes;
iclModule->im_mfts_a.mfts_type_symbol_a = gBEState.be_modules [main_dcl_module_n].bem_types;
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
iclModule->im_imported_objs = NULL;
iclModule->im_imported_libs = NULL;
......@@ -429,20 +416,12 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT
char *cName;
SymbolP moduleNameSymbol;
DefMod dclModule;
SymbolP saved_function_symbols,previous_all_symbols;
cName = ConvertCleanString (name);
moduleNameSymbol = ConvertAllocType (SymbolS);
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);
dclModule = ConvertAllocType (DefRepr);
......@@ -450,16 +429,11 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT
dclModule->dm_module_n = moduleIndex;
dclModule->dm_modification_time = ConvertCleanString (modificationTime);
dclModule->dm_system_module = isSystemModule;
dclModule->dm_function_symbols = gBEState.be_function_symbols;
dclModule->dm_symbols_end = previous_all_symbols;
dclModule->dm_function_symbol_a = gBEState.be_modules[moduleIndex].bem_functions;
dclModule->dm_n_function_symbols = gBEState.be_modules[moduleIndex].bem_nFunctions;
dclModule->dm_system_module_table_kind = FirstSystemModuleTable + moduleIndex;
AddOpenDefinitionModule (moduleNameSymbol, dclModule);
if (moduleIndex == main_dcl_module_n){
gBEState.be_function_symbols = saved_function_symbols;
im_def_module=dclModule;
}
} /* BEDeclareDclModule */
void
......@@ -564,10 +538,11 @@ BESymbolP
BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, int moduleIndex)
{
BEModuleP module;
SymbolP functionSymbol,previousFunctionSymbol;
SymbolP functionSymbol;
SymbDefP originalsdef;
TypeAlt *typeAlt;
TypeNode elementType, arrayType;
SymbDef previousFunctionSymbDef;
Assert ((unsigned int) moduleIndex < gBEState.be_nModules);
module = &gBEState.be_modules [moduleIndex];
......@@ -599,21 +574,18 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
return (functionSymbol);
}
previousFunctionSymbol = functionSymbol;
functionSymbol = functionSymbol->symb_next;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition){
previousFunctionSymbDef = originalsdef;
if (previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION){
functionSymbol = previousFunctionSymbDef->sdef_special_array_function_symbol;
if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
return functionSymbol;
if (arrayFunKind == BE_UnqArraySelectLastFun && functionSymbol->symb_def->sdef_arfun == BE_UnqArraySelectFun){
previousFunctionSymbol = functionSymbol;
functionSymbol = functionSymbol->symb_next;
if (functionSymbol != NULL && functionSymbol->symb_kind == definition &&
functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
{
return functionSymbol;
previousFunctionSymbDef = functionSymbol->symb_def;
if (previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION){
functionSymbol = previousFunctionSymbDef->sdef_special_array_function_symbol;
if (functionSymbol->symb_def->sdef_arfun == (ArrayFunKind) arrayFunKind)
return functionSymbol;
}
}
}
......@@ -720,9 +692,14 @@ BESpecialArrayFunctionSymbol (BEArrayFunKind arrayFunKind, int functionIndex, in
newFunctionSymbol->symb_kind = definition;
newFunctionSymbol->symb_def = newsdef;
functionSymbol = previousFunctionSymbol->symb_next;
previousFunctionSymbol->symb_next = newFunctionSymbol;
newFunctionSymbol->symb_next = functionSymbol;
if ((previousFunctionSymbDef->sdef_mark & SDEF_HAS_SPECIAL_ARRAY_FUNCTION)==0){
previousFunctionSymbDef->sdef_special_array_function_symbol = newFunctionSymbol;
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);
......@@ -3281,14 +3258,12 @@ static void init_unboxed_list_symbols (void)
symbol_p->symb_head_strictness=4;
symbol_p->symb_tail_strictness=0;
symbol_p->symb_state_p=&BasicSymbolStates[i];
symbol_p->symb_next=NULL;
symbol_p=&unboxed_list_symbols[i][1];
symbol_p->symb_kind=cons_symb;
symbol_p->symb_head_strictness=4;
symbol_p->symb_tail_strictness=1;
symbol_p->symb_state_p=&BasicSymbolStates[i];
symbol_p->symb_next=NULL;
}
array_state_p=ConvertAllocType (StateS);
......@@ -3398,7 +3373,6 @@ BEInit (int argc)
gBEState.be_argi = 0;
gBEState.be_modules = NULL;
gBEState.be_function_symbols = NULL;
gBEState.be_dontCareSymbol = NULL;
gBEState.be_dictionarySelectFunSymbol = NULL;
gBEState.be_dictionaryUpdateFunSymbol = NULL;
......
......@@ -51,20 +51,21 @@ void ReadInlineCode (void)
def_mod=d_mod->mod_body;
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;
for (symbol=def_mod->dm_function_symbols; symbol!=NULL && symbol!=symbols_end; symbol=symbol->symb_next)
if (symbol->symb_kind==definition){
n_function_symbols=def_mod->dm_n_function_symbols;
function_symbol_a=def_mod->dm_function_symbol_a;
for (i=0; i<n_function_symbols; ++i)
if (function_symbol_a[i].symb_kind==definition){
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)
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 */
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)
break;
}
}
GenRtn (1,0,OnAState);
}
......@@ -1130,29 +1130,29 @@ void CodeGeneration (ImpMod imod, char *fname)
{
if (! CompilerError){
int DoStrictnessAnalysis_and_init_ok;
ImpRuleP new_rules;
CurrentPhase = NULL;
#if 0
PrintRules (imod->im_rules);
#endif
DetermineSharedAndAnnotatedNodes (imod->im_rules,&imod->im_function_symbols);
ExitOnInterrupt();
new_rules=DetermineSharedAndAnnotatedNodes (imod->im_rules);
#if 0
PrintRules (imod->im_rules,rules_file);
#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);
if (DoStrictnessAnalysis_and_init_ok){
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
{
......@@ -1168,11 +1168,8 @@ void CodeGeneration (ImpMod imod, char *fname)
generate_states (imod->im_rules,True);
if (DoStrictnessAnalysis_and_init_ok){
ExitOnInterrupt();
finish_strictness_analysis();
}
ExitOnInterrupt();
#if 0
PrintRules (imod->im_rules);
......@@ -1181,7 +1178,6 @@ void CodeGeneration (ImpMod imod, char *fname)
optimise_strict_tuple_result_functions=0;
OptimiseRules (imod->im_rules,imod->im_start);
ExitOnInterrupt();
#if 0
PrintRules (imod->im_rules,rules_file);
#endif
......@@ -1228,21 +1224,19 @@ void CodeGeneration (ImpMod imod, char *fname)
#endif
GenSystemImports();
FileComment();
ExitOnInterrupt();
ReadInlineCode ();
ReadInlineCode();
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);
if (imod->im_start)
GenStart (imod->im_start);
ExitOnInterrupt ();
#if SHARE_UPDATE_CODE
create_result_state_database (imod->im_rules);
......@@ -1275,8 +1269,6 @@ void CodeGeneration (ImpMod imod, char *fname)
}
update_function_p=&first_update_function;
}
ExitOnInterrupt ();
}
GenerateCodeForLazyTupleSelectorEntries (LazyTupleSelectors);
......@@ -1285,7 +1277,7 @@ void CodeGeneration (ImpMod imod, char *fname)
GenerateCodeForLazyUnboxedRecordListFunctions();
#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();
WriteLastNewlineToABCFile();
......
......@@ -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;
SymbolP type_symbol_a;
......@@ -1611,8 +1611,8 @@ void GenerateCodeForConstructorsAndRecords (struct module_type_symbols mts)
PolyList unboxed_record_cons_element;
#endif
n_types = mts.mts_n_types;
type_symbol_a = mts.mts_type_symbol_a;
n_types = mfts.mfts_n_types;
type_symbol_a = mfts.mfts_type_symbol_a;
for (i=0; i<n_types; ++i){
if (type_symbol_a[i].symb_kind==definition){
SymbDef def;
......
......@@ -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 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 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)
static char Init[] = "Compiler initialization";
Bool InterruptFlag;
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)
{
InterruptFlag = False;
OpenedFile = (File) NIL;
CompilerError = False;
/* Call all the initialization functions */
......
......@@ -113,7 +113,7 @@ Bool OpenABCFile (char *fname)
OutFile = FOpen (fname, abcFile, "w");
if (OutFile!=NULL){
#if defined (THINK_C) || defined (POWER)
#if defined (POWER)
setvbuf ((FILE*) OutFile, NULL, _IOFBF, 8192);
#endif
OpenedFile = OutFile;
......@@ -131,16 +131,7 @@ void WriteLastNewlineToABCFile (void)
void CloseABCFile (char *fname)
{
if (OutFile){
#ifdef THINK_C
int file_io_error;
file_io_error=ferror (OutFile);
#endif
if (FClose (OutFile) != 0
#ifdef THINK_C
|| file_io_error
#endif
){
if (FClose (OutFile) != 0){
CompilerError = True;
CurrentLine = 0;
......@@ -3455,11 +3446,7 @@ void GenModuleDescriptor (
if (WriteModificationTimes){
FPutC (' ',OutFile);
FPutC ('\"',OutFile);
# if CLEAN2
FPutS (file_time,OutFile);
# else
FWriteFileTime (file_time,OutFile);
# endif
FPutC ('\"',OutFile);
}
#endif
......@@ -3478,11 +3465,7 @@ 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
......
......@@ -2,19 +2,11 @@
* MAC Dependencies *
******************************************************************************/
#ifdef THINK_C
typedef int TwoBytesInt;
typedef long int FourBytesInt;
typedef unsigned TwoBytesUnsigned;
typedef unsigned long FourBytesUnsigned;
typedef short double EightBytesReal;
#else
typedef short TwoBytesInt;
typedef int FourBytesInt;
typedef unsigned short TwoBytesUnsigned;
typedef unsigned int FourBytesUnsigned;
typedef double EightBytesReal;
#endif
typedef short TwoBytesInt;
typedef int FourBytesInt;
typedef unsigned short TwoBytesUnsigned;
typedef unsigned int FourBytesUnsigned;
typedef double EightBytesReal;
typedef float FourBytesReal;
#define SizeT unsigned long
......@@ -27,26 +19,15 @@ typedef float FourBytesReal;
#include <string.h>
#include <stdlib.h>
#ifdef THINK_C
# include <unix.h>
#else
# include <stdio.h>
#endif
#include <stdio.h>
#include <setjmp.h>
#include <stdarg.h>
typedef FILE *File;
#ifdef THINK_C
/* special for MacIntosh command line support */
extern void InitIO (void);
extern void GetPreferences (char *fname);
#else
void GetInitialPathList (void);
void FreePathList (void);
#endif
void GetInitialPathList (void);
void FreePathList (void);
#define StdOut stdout
#if defined (__MWERKS__) || defined (__MRC__)
......@@ -62,9 +43,3 @@ typedef FILE *File;
#define FGetS(s,n,f) fgets(s,n,f)
#define FPutC(c,f) fputc(c,f)
extern int open_dcl_file_for_block_reading (char *fname,File *file_p);
extern int read_next_block_from_dcl_file (char *buffer);
#if WRITE_DCL_MODIFICATION_TIME
extern int open_dcl_file_for_block_reading_with_file_time (char *file_name,File *file_p,FileTime *file_time_p);
#endif
\ No newline at end of file
......@@ -902,12 +902,6 @@ void CmdError (char *errormsg,...)
va_end (args);
}
extern long GetMainModuleVolume (void);
long GetMainModuleVolume (void)
{
return 0;
}
void Free (void *p)
{
#if USE_SYSTEM_ALLOC
......
......@@ -2185,21 +2185,8 @@ static void InitNode (Node node)
static void InitAlternative (RuleAltS *alt)
{
#ifndef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
NodeDefs nds;
#endif
InitNode (alt->alt_lhs_root);
#ifndef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
for_l (nds,alt->alt_lhs_defs,def_next){
if (nds->def_id)
nds->def_id->nid_exp_ = NULL;
InitNode (nds->def_node);
}
#endif
if (alt->alt_kind==Contractum){
InitNode (alt->alt_rhs_root);
InitNodeDefs (alt->alt_rhs_defs);
......@@ -2412,7 +2399,7 @@ static Exp ConvertNode (Node node, NodeId nid)
return e;
} else {
e->e_fun = sdef->sdef_sa_fun;
if (arity==sdef->sdef_arity)
e->e_kind = Value;
else {
......@@ -2520,7 +2507,7 @@ static Exp ConvertNode (Node node, NodeId nid)
e->e_fun = selectsym [field_nr];
e->e_args = NewExpArgs (1);
e->e_args[0] = ConvertNode (arg->arg_node, Null);
break;
}
......@@ -2856,11 +2843,7 @@ static void ConvertAlternatives (Alts *funalts,RuleAlts rulealts)
InitAlternative (rulealts);
#ifndef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
fun_alt_p->fun_lhs = ConvertNodeDefs (rulealts->alt_lhs_root,rulealts->alt_lhs_defs,NULL);
#else
fun_alt_p->fun_lhs = ConvertNodeDefs (rulealts->alt_lhs_root,NULL,NULL);
#endif
has_fail = False;
......@@ -3676,7 +3659,7 @@ static void convert_type (SymbDef sdef)
}
static void ConvertSyntaxTree
(struct module_type_symbols mts,int size_dcl_type_symbols_a,struct module_type_symbols dcl_type_symbols_a[])
(struct module_function_and_type_symbols mfts,int size_dcl_type_symbols_a,struct module_function_and_type_symbols dcl_type_symbols_a[])