aboutsummaryrefslogtreecommitdiff
path: root/backendC
diff options
context:
space:
mode:
Diffstat (limited to 'backendC')
-rw-r--r--backendC/CleanCompilerSources/cocl.c3
-rw-r--r--backendC/CleanCompilerSources/instructions.c23
-rw-r--r--backendC/CleanCompilerSources/settings.c1
-rw-r--r--backendC/CleanCompilerSources/settings.h1
-rw-r--r--backendC/CleanCompilerSources/system.h1
-rw-r--r--backendC/CleanCompilerSources/types.t21
6 files changed, 19 insertions, 31 deletions
diff --git a/backendC/CleanCompilerSources/cocl.c b/backendC/CleanCompilerSources/cocl.c
index 2b758da..08bda7c 100644
--- a/backendC/CleanCompilerSources/cocl.c
+++ b/backendC/CleanCompilerSources/cocl.c
@@ -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]);
diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c
index 14bb5de..fbc2bb8 100644
--- a/backendC/CleanCompilerSources/instructions.c
+++ b/backendC/CleanCompilerSources/instructions.c
@@ -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){
diff --git a/backendC/CleanCompilerSources/settings.c b/backendC/CleanCompilerSources/settings.c
index bd6ea0e..105ffd0 100644
--- a/backendC/CleanCompilerSources/settings.c
+++ b/backendC/CleanCompilerSources/settings.c
@@ -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;
diff --git a/backendC/CleanCompilerSources/settings.h b/backendC/CleanCompilerSources/settings.h
index bf70cbc..a8234a2 100644
--- a/backendC/CleanCompilerSources/settings.h
+++ b/backendC/CleanCompilerSources/settings.h
@@ -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;
diff --git a/backendC/CleanCompilerSources/system.h b/backendC/CleanCompilerSources/system.h
index 38e98d5..89ac304 100644
--- a/backendC/CleanCompilerSources/system.h
+++ b/backendC/CleanCompilerSources/system.h
@@ -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,...);
diff --git a/backendC/CleanCompilerSources/types.t b/backendC/CleanCompilerSources/types.t
index 5ab61a5..909c22a 100644
--- a/backendC/CleanCompilerSources/types.t
+++ b/backendC/CleanCompilerSources/types.t
@@ -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