Basic block is purer range now, it does not hold start and length members, it can be used in range based fors now

This commit is contained in:
Artur K
2012-03-08 00:20:13 +01:00
parent fc0d35cf06
commit 69d848ca78
17 changed files with 403 additions and 400 deletions

View File

@@ -27,7 +27,7 @@ struct BB : public llvm::ilist_node<BB>
{
private:
BB(const BB&);
BB() : start(0),length(0),nodeType(0),traversed(0),
BB() : nodeType(0),traversed(0),
numHlIcodes(0),flg(0),
inEdges(0),
edges(0),beenOnH(0),inEdgeCount(0),reachingInt(0),
@@ -38,19 +38,13 @@ private:
}
//friend class SymbolTableListTraits<BB, Function>;
//int numInEdges; /* Number of in edges */
int start; /* First instruction offset */
int length; /* No. of instructions this BB */
iICODE range_start;
iICODE range_end;
public:
int begin();
iICODE begin2();
iICODE end2();
int end();
int rbegin();
int rend();
riICODE rbegin2();
riICODE rend2();
iICODE begin();
iICODE end();
riICODE rbegin();
riICODE rend();
ICODE &front();
ICODE &back();
size_t size();

View File

@@ -87,10 +87,10 @@ public:
static bool insertSubTreeLongReg(COND_EXPR *exp, COND_EXPR **tree, int longIdx);
static bool insertSubTreeReg(COND_EXPR *&tree, COND_EXPR *_expr, eReg regi, LOCAL_ID *locsym);
public:
virtual COND_EXPR *clone();
virtual COND_EXPR *clone() const;
void release();
void changeBoolOp(condOp newOp);
COND_EXPR(COND_EXPR &other)
COND_EXPR(const COND_EXPR &other)
{
type=other.type;
expr=other.expr;
@@ -104,7 +104,7 @@ public:
}
virtual ~COND_EXPR() {}
public:
virtual COND_EXPR *inverse(); // return new COND_EXPR that is invarse of this
virtual COND_EXPR *inverse() const; // return new COND_EXPR that is invarse of this
virtual bool xClear(iICODE f, iICODE t, iICODE lastBBinst, Function *pproc);
virtual COND_EXPR *insertSubTreeReg(COND_EXPR *_expr, eReg regi, LOCAL_ID *locsym);
virtual COND_EXPR *insertSubTreeLongReg(COND_EXPR *_expr, int longIdx);

View File

@@ -167,7 +167,7 @@ hlType expType (const COND_EXPR *, Function *);
/* Exported functions from hlicode.c */
std::string writeCall (Function *, STKFRAME *, Function *, int *);
char *writeJcond (HLTYPE, Function *, int *);
char *writeJcond (const HLTYPE &, Function *, int *);
char *writeJcondInv (HLTYPE, Function *, int *);
int power2 (int);

View File

@@ -78,6 +78,8 @@ struct AssignType : public HlTypeSupport
return true;
}
std::string writeOut(Function *pProc, int *numLoc);
AssignType() : lhs(0),rhs(0)
{}
};
struct ExpType : public HlTypeSupport
{
@@ -120,6 +122,7 @@ public:
exp.v=e;
}
COND_EXPR * expr() { return exp.v;}
const COND_EXPR * const expr() const { return exp.v;}
void set(hlIcode i,COND_EXPR *e)
{
if(i!=HLI_RET)
@@ -337,7 +340,7 @@ public:
void setRegDU(eReg regi, operDu du_in);
void invalidate();
void newCallHl();
void writeDU(int idx);
void writeDU();
condId idType(opLoc sd);
// HLL setting functions
// set this icode to be an assign