2022-11-20 05:07:22 +00:00
|
|
|
#ifndef COMPILER_USEDEFCHAINS_H
|
|
|
|
#define COMPILER_USEDEFCHAINS_H
|
|
|
|
|
|
|
|
#include "compiler/common.h"
|
2022-12-14 00:16:59 +00:00
|
|
|
#include "compiler/PCodeInfo.h"
|
|
|
|
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
#pragma options align=mac68k
|
|
|
|
#endif
|
|
|
|
typedef struct TinyValue {
|
|
|
|
PCOpKind kind;
|
2022-12-14 01:00:56 +00:00
|
|
|
RegClass arg;
|
2022-12-14 00:16:59 +00:00
|
|
|
union {
|
|
|
|
short reg;
|
|
|
|
Object *object;
|
|
|
|
} u;
|
|
|
|
} TinyValue;
|
|
|
|
|
|
|
|
typedef struct UseDefInfo {
|
|
|
|
UInt32 *defvec0;
|
|
|
|
UInt32 *defvec4;
|
|
|
|
UInt32 *defvec8;
|
|
|
|
UInt32 *defvecC;
|
|
|
|
UInt32 *usevec10;
|
|
|
|
UInt32 *usevec14;
|
|
|
|
UInt32 *usevec18;
|
|
|
|
UInt32 *usevec1C;
|
|
|
|
} UseDefInfo;
|
|
|
|
|
|
|
|
typedef struct UseOrDef {
|
|
|
|
PCode *pcode;
|
|
|
|
TinyValue v;
|
|
|
|
} UseOrDef;
|
|
|
|
|
|
|
|
typedef struct RegUseOrDef {
|
|
|
|
struct RegUseOrDef *next;
|
|
|
|
int id;
|
|
|
|
} RegUseOrDef;
|
|
|
|
|
|
|
|
typedef struct ObjectUseDef {
|
|
|
|
struct ObjectUseDef *next;
|
|
|
|
struct ObjectUseDef *leftchild;
|
|
|
|
struct ObjectUseDef *rightchild;
|
|
|
|
Object *object;
|
|
|
|
RegUseOrDef *uses;
|
|
|
|
RegUseOrDef *defs;
|
|
|
|
} ObjectUseDef;
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
#pragma options align=reset
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern int number_of_Defs;
|
|
|
|
extern UseOrDef *Defs;
|
|
|
|
extern RegUseOrDef **reg_Defs[RegClassMax];
|
|
|
|
extern int number_of_Uses;
|
|
|
|
extern UseOrDef *Uses;
|
|
|
|
extern RegUseOrDef **reg_Uses[RegClassMax];
|
|
|
|
extern UseDefInfo *usedefinfo;
|
|
|
|
extern ObjectUseDef *objectusedefs;
|
|
|
|
extern ObjectUseDef *objectusedeflist;
|
|
|
|
|
|
|
|
extern ObjectUseDef *findobjectusedef(Object *object);
|
|
|
|
extern void computeusedefchains(int flag);
|
2022-11-20 05:07:22 +00:00
|
|
|
|
|
|
|
#endif
|