summaryrefslogtreecommitdiff
path: root/includes/compiler/COptimizer.h
blob: 4e013340ec0618b69bd402bdd9fd7f708bc42ef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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