more iterators in other places

This commit is contained in:
Artur K
2011-12-14 00:17:10 +01:00
parent 01ae1229bb
commit f009e33799
9 changed files with 279 additions and 166 deletions

View File

@@ -8,6 +8,7 @@
static const int operandSize=20;
#include <cstring>
#include "Enums.h"
#include "icode.h"
/* The following definitions and types define the Conditional Expression
* attributed syntax tree, as defined by the following EBNF:
CondExp ::= CondTerm AND CondTerm | CondTerm
@@ -59,10 +60,10 @@ public:
static COND_EXPR *idOther(byte seg, byte regi, int16 off);
static COND_EXPR *idParam(Int off, const STKFRAME *argSymtab);
static COND_EXPR *unary(condNodeType t, COND_EXPR *sub_expr);
static COND_EXPR *idLong(LOCAL_ID *localId, opLoc sd, ICODE *pIcode, hlFirst f, Int ix, operDu du, Int off);
static COND_EXPR *idLong(LOCAL_ID *localId, opLoc sd, iICODE pIcode, hlFirst f, Int ix, operDu du, Int off);
static COND_EXPR *idFunc(Function *pproc, STKFRAME *args);
static COND_EXPR *idID(const ID *retVal, LOCAL_ID *locsym, Int ix);
static COND_EXPR *id(ICODE *pIcode, opLoc sd, Function *pProc, Int i, ICODE *duIcode, operDu du);
static COND_EXPR *id(const ICODE &pIcode, opLoc sd, Function *pProc, Int i, ICODE &duIcode, operDu du);
static COND_EXPR *boolOp(COND_EXPR *lhs, COND_EXPR *rhs, condOp op);
public:
COND_EXPR *clone();
@@ -78,6 +79,7 @@ public:
type=UNKNOWN_OP;
memset(&expr,0,sizeof(_exprNode));
}
public:
};
/* Sequence of conditional expression data type */

View File

@@ -211,8 +211,8 @@ Int power2 (Int);
void inverseCondOp (COND_EXPR **);
/* Exported funcions from locident.c */
boolT checkLongEq (LONG_STKID_TYPE, ICODE *, Int, Int, Function *, COND_EXPR **,COND_EXPR **, Int);
boolT checkLongRegEq (LONGID_TYPE, ICODE *, Int, Int, Function *, COND_EXPR **,COND_EXPR **, Int);
boolT checkLongEq (LONG_STKID_TYPE, iICODE, Int, Int, Function *, COND_EXPR **,COND_EXPR **, Int);
boolT checkLongRegEq (LONGID_TYPE, iICODE, Int, Int, Function *, COND_EXPR **,COND_EXPR **, Int);
byte otherLongRegi (byte, Int, LOCAL_ID *);
void insertIdx (IDX_ARRAY *, Int);

View File

@@ -282,7 +282,7 @@ struct HLTYPE
} oper; /* operand */
} ;
typedef struct
struct LLTYPE
{
llIcode opcode; /* llIcode instruction */
byte numBytes; /* Number of bytes this instr */
@@ -303,7 +303,11 @@ typedef struct
dword *entries; /* array of offsets */
} caseTbl;
Int hllLabNum; /* label # for hll codegen */
} LLTYPE;
bool conditionalJump()
{
return (opcode >= iJB) && (opcode < iJCXZ);
}
};
/* Icode definition: LOW_LEVEL and HIGH_LEVEL */
struct ICODE