Commit e5b6ff65 authored by John van Groningen's avatar John van Groningen
Browse files

add -fusion flag

parent 17a55edb
......@@ -151,6 +151,7 @@ Bool CallCompiler (int argc, char **argv)
DoProfiling=False;
DoTimeProfiling=False;
DoReuseUniqueNodes=False;
DoFusion=False;
DoDescriptors=False;
ExportLocalLabels=False;
......@@ -221,6 +222,8 @@ Bool CallCompiler (int argc, char **argv)
DoDescriptors=True;
else if (strcmp (argv_i,"-exl") ==0)
ExportLocalLabels=True;
else if (strcmp (argv_i,"-fusion") == 0)
DoFusion=True;
else if (strncmp (argv_i, "-sa", 3) == 0){
if (!SetStrictOption (argv[i]+3)){
CmdError ("unknown flag %s", argv[i]);
......
......@@ -54,8 +54,12 @@ static void error_in_function (char *m)
*/
#define N_DoWarning 7
#define N_System 8
#define N_DoFusion 9
static void ConvertOptionsToString (CompilerOptions options,char *optstring)
#define MINIMUM_N_OPTIONS 9
#define N_OPTIONS 10
static void ConvertOptionsToString (char *optstring)
{
optstring[N_DoDebug] = DoDebug ? '1' : '0';
optstring[N_DoReuseUniqueNodes] = !DoReuseUniqueNodes ? '1' : '0';
......@@ -74,7 +78,11 @@ static void ConvertOptionsToString (CompilerOptions options,char *optstring)
*/
optstring[N_DoWarning] = DoWarning ? '1' : '0';
optstring[N_System] = '0';
optstring[NR_OPTIONS] = '\0';
if (DoFusion){
optstring[N_DoFusion]='1';
optstring[N_OPTIONS]='\0';
} else
optstring[MINIMUM_N_OPTIONS]='\0';
}
#define D_PREFIX "d"
......@@ -681,7 +689,6 @@ static void put_instruction_code (int instruction_code)
#define Dmodule "module"
#define Ddepend "depend"
#define Dcomp "comp"
#define Dcode "code"
#define Dstart "start"
#define Dstring "string"
#define Dcaf "caf"
......@@ -763,7 +770,7 @@ void FillBasicFromB (ObjectKind kind, int boffs, int aoffs, FillKind fkind)
put_arguments_nn_b (boffs,aoffs);
TreatWaitListAfterFill (aoffs, fkind);
}
void BuildBasic (ObjectKind obj,SymbValue val)
{
switch (obj){
......@@ -3364,22 +3371,18 @@ void GenSelectorDescriptor (Label sellab,char *g_pref)
void InitFileInfo (ImpMod imod)
{
char option_string[NR_OPTIONS+1];
CompilerOptions opts;
char option_string[N_OPTIONS+1];
SymbDef start_sdef;
start_sdef=imod->im_start;
ConvertOptionsToString (opts,option_string);
ConvertOptionsToString (option_string);
if (imod->im_def_module!=NULL && imod->im_def_module->dm_system_module)
option_string[N_System]='1';
put_first_directive_ (Dcomp);
FPrintF (OutFile, "%d %s", VERSION,option_string);
put_directive_ (Dcode);
FPrintF (OutFile, "%7ld %7ld %7ld", (long) 0, (long) 0, (long) 0);
put_directive_ (Dstart);
if (start_sdef!=NULL){
......
......@@ -28,6 +28,7 @@ Bool DoProfiling=False; /* no longer used by memory profiler */
Bool DoTimeProfiling=False;
Bool DoReuseUniqueNodes = False;
Bool DoFusion = False;
Bool OptimizeLazyTupleRecursion=False;
Bool OptimizeTailCallModuloCons=True;
......
......@@ -27,6 +27,7 @@ extern Bool DoProfiling;
extern Bool DoTimeProfiling;
extern Bool DoReuseUniqueNodes;
extern Bool DoFusion;
extern Bool OptimizeLazyTupleRecursion;
extern Bool OptimizeTailCallModuloCons;
extern Bool WriteModificationTimes;
......
......@@ -70,7 +70,6 @@ extern FileTime FGetFileTime (char *fname, FileKind kind);
#if defined(WRITE_DCL_MODIFICATION_TIME) && WRITE_DCL_MODIFICATION_TIME
extern void FWriteFileTime (FileTime file_time,File f);
#endif
extern Bool GetOptionsFromIclFile (char *fname, CompilerOptions *opts);
#ifdef _VARARGS_
extern void DoError (char *fmt,...);
......
......@@ -13,7 +13,7 @@
#define NIL 0L
#define Null 0L
#define REALSIZE 2
#define REALSIZE 2 /*1*/
#define FILESIZE 2
#define KBYTE 1024L
......@@ -45,25 +45,6 @@ typedef enum
typedef unsigned long SysTime;
#define NR_OPTIONS 9
typedef struct
{
unsigned opt_code:1,
opt_debug:1,
opt_inline:1,
opt_listalltypes:1,
opt_listtypes:1,
opt_parallel:1,
opt_stacklayout:1,
opt_strictnessanalysis:1,
opt_typecheck:1,
opt_verbose:1,
opt_warning:1,
opt_system:1,
opt_liststricttypes:1;
} CompilerOptions;
#ifdef _WINDOWS_
# include <stdarg.h>
# define FileTime FILETIME
......
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