moving on

This commit is contained in:
Artur K
2012-02-22 11:17:54 +01:00
parent fa2eac979d
commit ed6f24a79a
29 changed files with 1662 additions and 1656 deletions

View File

@@ -83,7 +83,9 @@ public:
public:
static Function *Create(void *ty=0,int Linkage=0,const std::string &nm="",void *module=0)
{
return new Function(ty);
Function *r=new Function(ty);
strncpy(r->name,nm.c_str(),SYMLEN);
return r;
}
void compoundCond();
void writeProcComments();

View File

@@ -194,13 +194,7 @@ Int hlTypeSize (const COND_EXPR *, Function *);
hlType expType (const COND_EXPR *, Function *);
boolT insertSubTreeReg (COND_EXPR *, COND_EXPR **, byte, LOCAL_ID *);
boolT insertSubTreeLongReg (COND_EXPR *, COND_EXPR **, Int);
//COND_EXPR *concatExps (SEQ_COND_EXPR *, COND_EXPR *, condNodeType);
void initExpStk();
void pushExpStk (COND_EXPR *);
COND_EXPR *popExpStk();
Int numElemExpStk();
boolT emptyExpStk();
/* Exported functions from hlicode.c */
std::string writeCall (Function *, STKFRAME *, Function *, Int *);

View File

@@ -1,4 +1,4 @@
/*
/*
* File: hlIcode.h
* Purpose: module definitions for high-level icodes
* Date: September 1993
@@ -6,16 +6,8 @@
/* High level icodes opcodes - def in file icode.h */
/*typedef enum {
HLI_ASSIGN,
INC,
DEC,
HLI_JCOND,
} hlIcode; */
typedef struct {
struct HLICODE
{
hlIcode opcode; /* hlIcode opcode */
union { /* different operands */
struct {
@@ -25,12 +17,4 @@ typedef struct {
COND_EXPR *exp; /* for HLI_JCOND, INC, DEC */
} oper; /* operand */
boolT valid; /* has a valid hlIcode */
} HLICODE;
//typedef struct {
// Int numIcodes; /* No. of hlIcode reocrds written */
// Int numAlloc; /* No. of hlIcode records allocated */
// HLICODE *hlIcode; /* Array of high-level icodes */
//} HLICODEREC;
};

View File

@@ -293,8 +293,8 @@ struct LLTYPE
union { /* Source operand if (flg & I) */
dword op; /* idx of immed src op */
struct { /* Call & # actual arg bytes */
Function *proc; /* ^ target proc (for CALL(F))*/
Int cb; /* # actual arg bytes */
Function *proc; /* pointer to target proc (for CALL(F))*/
int cb; /* # actual arg bytes */
} proc;
} immed;
DU flagDU; /* def/use of flags */
@@ -312,12 +312,12 @@ struct LLTYPE
/* Icode definition: LOW_LEVEL and HIGH_LEVEL */
struct ICODE
{
struct DU1
{
Int numRegsDef; /* # registers defined by this inst */
byte regi[MAX_REGS_DEF]; /* registers defined by this inst */
Int idx[MAX_REGS_DEF][MAX_USES]; /* inst that uses this def */
};
struct DU1
{
Int numRegsDef; /* # registers defined by this inst */
byte regi[MAX_REGS_DEF]; /* registers defined by this inst */
Int idx[MAX_REGS_DEF][MAX_USES]; /* inst that uses this def */
};
icodeType type; /* Icode type */
boolT invalid; /* Has no HIGH_LEVEL equivalent */
BB *inBB; /* BB to which this icode belongs */
@@ -351,6 +351,7 @@ struct DU1
void copyDU(const ICODE &duIcode, operDu _du, operDu duDu);
public:
boolT removeDefRegi(byte regi, Int thisDefIdx, LOCAL_ID *locId);
void checkHlCall();
};
// This is the icode array object.