summaryrefslogtreecommitdiff
path: root/includes/compiler/COptimizer.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
committerAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
commit9d2728a5605f651934fe67a6fe6986b3e4a2c011 (patch)
treee81e0a3588a0c8d1855bf28316efe27d86b04d66 /includes/compiler/COptimizer.h
parent9a46dd0e2e80790d9848c0bbd718932a27c23269 (diff)
downloadMWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.tar.gz
MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.zip
add a bunch of code and a ton of stub files for later
Diffstat (limited to '')
-rw-r--r--includes/compiler/COptimizer.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/includes/compiler/COptimizer.h b/includes/compiler/COptimizer.h
new file mode 100644
index 0000000..4e01334
--- /dev/null
+++ b/includes/compiler/COptimizer.h
@@ -0,0 +1,55 @@
+#ifndef COMPILER_COPTIMIZER_H
+#define COMPILER_COPTIMIZER_H
+
+#include "compiler/common.h"
+
+#ifdef __MWERKS__
+#pragma options align=mac68k
+#endif
+typedef struct COptBlockList {
+ struct COptBlockList *next;
+ struct COptBlock *block;
+} COptBlockList;
+
+typedef struct COptBlock {
+ struct COptBlock *next;
+ COptBlockList *blocks;
+ COptBlockList *blocks2;
+ Statement *stmt;
+ short *set1;
+ short *set2;
+ UInt32 allocmask;
+ short x1C;
+ Boolean x1E;
+} COptBlock;
+
+typedef struct COptCSE {
+ struct COptCSE *next;
+ struct COptCSE *left;
+ struct COptCSE *right;
+ COptBlock *block;
+ ENode *expr;
+ ENode *mexpr;
+ ENode *replaced;
+ short x1C;
+} COptCSE;
+
+typedef struct COptCSEList {
+ struct COptCSEList *next;
+ COptCSE *cse;
+ ENode *expr;
+} COptCSEList;
+#ifdef __MWERKS__
+#pragma options align=reset
+#endif
+
+extern COptBlock *basicblocks;
+extern Boolean copt_isleaffunction;
+
+extern UInt32 RegAllocMask(short var);
+extern void MarkRegAllocMask(short var, short bit, Boolean flag);
+extern void SetVarUsage(Object *obj, Boolean noregister);
+extern void COpt_SimpleOptimizer(Object *obj, Statement *stmt);
+extern Statement *COpt_Optimizer(Object *obj, Statement *stmt);
+
+#endif