diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-01-26 11:30:47 +0000 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-01-26 11:30:47 +0000 |
commit | 094b96ca1df4a035b5f93c351f773306c0241f3f (patch) | |
tree | 95ce05e3ebe816c7ee7996206bb37ea17d8ca33c /includes/compiler/IroLinearForm.h | |
parent | fc0c4c0df7b583b55a08317cf1ef6a71d27c0440 (diff) | |
download | MWCC-094b96ca1df4a035b5f93c351f773306c0241f3f.tar.gz MWCC-094b96ca1df4a035b5f93c351f773306c0241f3f.zip |
move lots of source files around to match their actual placement in the original treemain
Diffstat (limited to 'includes/compiler/IroLinearForm.h')
-rw-r--r-- | includes/compiler/IroLinearForm.h | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/includes/compiler/IroLinearForm.h b/includes/compiler/IroLinearForm.h deleted file mode 100644 index 1e7df4f..0000000 --- a/includes/compiler/IroLinearForm.h +++ /dev/null @@ -1,165 +0,0 @@ -#ifndef COMPILER_IROLINEARFORM_H -#define COMPILER_IROLINEARFORM_H - -#include "compiler/IrOptimizer.h" -#include "compiler/Switch.h" -#include "compiler/enode.h" - -#ifdef __MWERKS__ -#pragma options align=mac68k -#endif - -typedef struct IROLinearIRSave { - IROLinear *firstLinear; - IROLinear *lastLinear; - UInt32 numLinear; - Statement *curStat; - Boolean disableDueToAsm; - Boolean isLeafFunction; - Boolean functionHasReturn; - void *nullCheckList; - Statement *currStmt; - Statement *prevStmt; -} IROLinearIRSave; - -typedef enum IROLinearType { - IROLinearNop, - IROLinearOperand, - IROLinearOp1Arg, - IROLinearOp2Arg, - IROLinearGoto, - IROLinearIf, - IROLinearIfNot, - IROLinearReturn, - IROLinearLabel, - IROLinearSwitch, - IROLinearOp3Arg, - IROLinearFunccall, - IROLinearEntry, - IROLinearExit, - IROLinearBeginCatch, - IROLinearEndCatch, - IROLinearEndCatchDtor, - IROLinearAsm, - IROLinear18, - IROLinear19, - IROLinearEnd -} IROLinearType; - -enum { - IROLF_1 = 0x1, - IROLF_Reffed = 0x2, - IROLF_Assigned = 0x4, - IROLF_8 = 0x8, - IROLF_Used = 0x10, - IROLF_Ind = 0x20, - IROLF_Subs = 0x40, - IROLF_80 = 0x80, - IROLF_LoopInvariant = 0x100, - IROLF_BeginLoop = 0x200, - IROLF_EndLoop = 0x400, - IROLF_Ris = 0x800, - IROLF_Immind = 0x1000, - IROLF_VecOp = 0x2000, - IROLF_4000 = 0x4000, - IROLF_8000 = 0x8000, - IROLF_VecOpBase = 0x10000, - IROLF_20000 = 0x20000, - IROLF_CounterLoop = 0x40000, - IROLF_BitfieldIndirect = 0x80000, - IROLF_CouldError = 0x100000 -}; - -// actual name is LinearNode as per mwccppc v8 -struct IROLinear { - IROLinearType type; - ENodeType nodetype; - SInt32 flags; - UInt16 nodeflags; - unsigned short index; - Statement *stmt; - Type *rtype; - IROExpr *expr; - struct ERange *x16; - PointsToFunction *pointsToFunction; - Boolean x1E; - union { - struct { - void *data1; - void *data2; - void *data3; - void *data4; - void *data5; - } idk; - // Operand - ENode *node; - // Op1Arg - IROLinear *monadic; - // Op2Arg - struct { - IROLinear *left; - IROLinear *right; - } diadic; - // Op3Arg - struct { - IROLinear *a; - IROLinear *b; - IROLinear *c; - } args3; - // Funccall - struct { - char ispascal; - short argCount; - IROLinear **args; - IROLinear *linear8; // funcref - TypeFunc *functype; - struct LocationSetSet *returnedLocs; - } funccall; - // Asm - Statement *asm_stmt; - // If, IfNot, Goto, Label - struct { - CLabel *label; - IROLinear *x4; // if,ifnot only?? - } label; - struct { - SwitchInfo *info; - IROLinear *x4; - } swtch; - // BeginCatch, EndCatch, EndCatchDtor - struct { - IROLinear *linear; - int x4; - int x8; - } ctch; - } u; - IROLinear *next; -}; - -#ifdef __MWERKS__ -#pragma options align=reset -#endif - -extern IROLinear *IRO_FirstLinear; -extern IROLinear *IRO_LastLinear; -extern UInt32 IRO_NumLinear; -extern Statement *CurStat; - -extern IROLinear *IRO_NewLinear(IROLinearType type); -extern void IRO_PreLinearize(Statement *stmt); -extern void IRO_Linearize(Statement *stmt); -extern ENode *IRO_NewENode(ENodeType nodetype); -extern Statement *IRO_Delinearize(IRONode *node, IROLinear *linear); -extern void IRO_RenumberInts(void); -extern void IRO_UpdateFlagsOnInts(void); -extern void IRO_SaveLinearIR(IROLinearIRSave *save); -extern void IRO_RestoreLinearIR(IROLinearIRSave *save); - -#define IS_LINEAR_ENODE(_linear, _nodetype) ( ((_linear)->type == IROLinearOperand) && ((_linear)->u.node->type) == (_nodetype) ) -#define IS_LINEAR_MONADIC(_linear, _nodetype) ( ((_linear)->type == IROLinearOp1Arg) && ((_linear)->nodetype) == (_nodetype) ) -#define IS_LINEAR_MONADIC_2(_linear, _nodetype1, _nodetype2) ( ((_linear)->type == IROLinearOp1Arg) && (((_linear)->nodetype) == (_nodetype1) || ((_linear)->nodetype) == (_nodetype2)) ) -#define IS_LINEAR_DIADIC(_linear, _nodetype) ( ((_linear)->type == IROLinearOp2Arg) && ((_linear)->nodetype) == (_nodetype) ) -#define IS_LINEAR_DIADIC_2(_linear, _nodetype1, _nodetype2) ( ((_linear)->type == IROLinearOp2Arg) && (((_linear)->nodetype) == (_nodetype1) || ((_linear)->nodetype) == (_nodetype2)) ) -#define IS_LINEAR_DIADIC_3(_linear, _nodetype1, _nodetype2, _nodetype3) ( ((_linear)->type == IROLinearOp2Arg) && (((_linear)->nodetype) == (_nodetype1) || ((_linear)->nodetype) == (_nodetype2) || ((_linear)->nodetype) == (_nodetype3)) ) - -#endif |