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

move remaining functions and definitions from checker_2.c and checker.h to other modules

parent d2dc64e5
......@@ -13,7 +13,6 @@
# include "sizes.h"
# include "set_scope_numbers.h"
# include "checker.h" /* ClearOpenDefinitionModules, AddOpenDefinitionModule */
# include "comsupport.h" /* CurrentModule */
# include "buildtree.h" /* TupleSymbol, ApplySymbol */
# include "sa.h" /* StdMiscId,abort_symb_def,undef_symb_def,scc_dependency_list */
......@@ -399,6 +398,17 @@ BEDeclareIclModule (CleanString name, CleanString modificationTime, int nFunctio
}
} /* BEDeclareIclModule */
static void AddOpenDefinitionModule (DefMod definitionModule)
{
DefModList openModule;
openModule = CompAllocType (DefModElem);
openModule->mod_body = definitionModule;
openModule->mod_next = OpenDefinitionModules;
OpenDefinitionModules = openModule;
}
void
BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationTime, int isSystemModule, int nFunctions, int nTypes, int nConstructors, int nFields)
{
......@@ -3321,8 +3331,6 @@ BEInit (int argc)
InitPredefinedSymbols ();
ClearOpenDefinitionModules ();
InitStatesGen ();
InitCoding ();
InitInstructions ();
......
......@@ -5,7 +5,6 @@
# include "comsupport.h"
# include "sizes.h"
# include "buildtree.h"
# include "checker.h"
SymbolP TrueSymbol, FalseSymbol, TupleSymbol,
SelectSymbols [MaxNodeArity], ApplySymbol, IfSymbol,
......
void InitChecker (void);
void GenDependencyList (void);
struct def_list {
DefMod mod_body;
struct def_list * mod_next;
};
extern struct def_list *OpenDefinitionModules;
void ClearOpenDefinitionModules (void);
void AddOpenDefinitionModule (DefMod definitionModule);
#include "compiledefines.h"
#include "types.t"
#include "system.h"
#include "syntaxtr.t"
#include "comsupport.h"
#include "sizes.h"
#include "buildtree.h"
#include "statesgen.h"
#include "codegen_types.h"
#include "codegen1.h"
#include "codegen2.h"
#include "instructions.h"
#include "checksupport.h"
#include "settings.h"
#include "checker.h"
#ifdef applec
# include <types.h>
#endif
#define for_l(v,l,n) for(v=(l);v!=NULL;v=v->n)
typedef struct def_list *DefModList,DefModElem;
struct def_list *OpenDefinitionModules;
void GenDependencyList (void)
{
DefModList def_mod;
for_l (def_mod,OpenDefinitionModules,mod_next)
GenDepend (def_mod->mod_body->dm_name
#if WRITE_DCL_MODIFICATION_TIME
,def_mod->mod_body->dm_modification_time
#endif
);
}
void InitChecker (void)
{
OpenDefinitionModules = NIL;
}
void ClearOpenDefinitionModules (void)
{
OpenDefinitionModules = NULL;
}
void AddOpenDefinitionModule (DefMod definitionModule)
{
DefModList openModule;
openModule = CompAllocType (DefModElem);
openModule->mod_body = definitionModule;
openModule->mod_next = OpenDefinitionModules;
OpenDefinitionModules = openModule;
}
......@@ -6,7 +6,6 @@
#include "checksupport.h"
#include "settings.h"
#include "buildtree.h"
#include "checker.h"
#include <ctype.h>
static int string_and_string_begin_equal (char *s1,char *s2_begin,char *s2_passed_end)
......
......@@ -11,7 +11,6 @@
#include "system.h"
#include "syntaxtr.t"
#include "comsupport.h"
#include "checker.h"
#include "settings.h"
#include "sa.h"
#include "statesgen.h"
......@@ -1193,7 +1192,17 @@ void CodeGeneration (ImpMod imod, char *fname)
else
ReduceError = &cycle_lab; /* in sequential case we have no reservation mechanism */
GenDependencyList();
{
DefModList def_mod;
for_l (def_mod,OpenDefinitionModules,mod_next)
#if WRITE_DCL_MODIFICATION_TIME
GenDepend (def_mod->mod_body->dm_name,def_mod->mod_body->dm_modification_time);
#else
GenDepend (def_mod->mod_body->dm_name);
#endif
}
#if IMPORT_OBJ_AND_LIB
{
struct string_list *sl;
......
......@@ -14,7 +14,6 @@
#include "syntaxtr.t"
#include "comsupport.h"
#include "sizes.h"
#include "checker.h"
#include "codegen_types.h"
#include "codegen1.h"
#include "sa.h"
......
......@@ -19,7 +19,6 @@
#include "settings.h"
#include "sizes.h"
#include "checker.h"
#include "codegen_types.h"
#include "statesgen.h"
#include "codegen.h"
......@@ -62,6 +61,8 @@ Bool LazyTupleSelectors [MaxNodeArity-NrOfGlobalSelectors];
LabDef BasicDescriptors [NrOfObjects];
int ObjectSizes [NrOfObjects];
struct def_list *OpenDefinitionModules;
static void InitBasicDescriptor (ObjectKind kind,char *name,int size)
{
BasicDescriptors[kind].lab_mod = NULL;
......@@ -6804,4 +6805,6 @@ void InitCoding (void)
next_update_function_n=0;
next_match_function_n=0;
OpenDefinitionModules = NULL;
}
......@@ -107,6 +107,8 @@ extern char *Co_Wtype,*Co_Wspine,else_symb[],then_symb[],notused_string[];
extern SymbDef ApplyDef,IfDef,SeqDef;
extern StateS StrictOnAState;
extern struct def_list *OpenDefinitionModules;
void FillSelectSymbol (StateKind result_state_kind,int arity,int argnr,Args arg,int *asp_p,int *bsp_p,
NodeId update_node_id,CodeGenNodeIdsP code_gen_node_ids_p);
void Build (Node node,int *asp_p,int *bsp_p,CodeGenNodeIdsP code_gen_node_ids_p);
......
......@@ -60,3 +60,10 @@ typedef struct label {
#define lab_name lab_u.u_name
#define lab_symbol lab_u.u_symbol
struct def_list {
DefMod mod_body;
struct def_list * mod_next;
};
typedef struct def_list *DefModList,DefModElem;
......@@ -23,7 +23,6 @@
#include "syntaxtr.t"
#include "comsupport.h"
#include "buildtree.h"
#include "checker.h"
#include "statesgen.h"
#include "codegen_types.h"
#include "codegen1.h"
......@@ -497,7 +496,6 @@ void InitCompiler (void)
InitStorage ();
InitGlobalSymbols();
InitChecker ();
InitStatesGen ();
InitCoding ();
InitInstructions ();
......
......@@ -6,7 +6,6 @@
#include "comsupport.h"
#include "settings.h"
#include "sizes.h"
#include "checker.h"
#include "checksupport.h"
#include "dbprint.h"
#include "codegen_types.h"
......
......@@ -9,7 +9,6 @@
#include "syntaxtr.t"
#include "comsupport.h"
#include "statesgen.h"
#include "checker.h"
#include "buildtree.h"
#include "codegen_types.h"
#include "optimisations.h"
......
......@@ -38,7 +38,6 @@
#include "sizes.h"
#include "syntaxtr.t"
#include "comsupport.h"
#include "checker.h"
#include "sa.t"
#include "sa.h"
#ifdef _DB_TEST_
......
......@@ -10,7 +10,6 @@
#include "codegen1.h"
#include "codegen2.h"
#include "statesgen.h"
#include "checker.h"
#include "instructions.h"
#include "optimisations.h"
#include "sa.h"
......
......@@ -19,7 +19,6 @@
#include "codegen1.h"
#include "codegen2.h"
#include "statesgen.h"
#include "checker.h"
#include "instructions.h"
#include "optimisations.h"
#include "sa.h"
......
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