cruft removal wip

This commit is contained in:
Artur K
2012-02-22 21:48:58 +01:00
parent 8cb5449591
commit 2b2eaeabe5
13 changed files with 131 additions and 246 deletions

View File

@@ -40,6 +40,12 @@ struct FunctionType
bool m_vararg;
bool isVarArg() const {return m_vararg;}
};
struct Assignment
{
COND_EXPR *lhs;
COND_EXPR *rhs;
};
struct Function : public llvm::ilist_node<Function>
{
typedef llvm::iplist<BB> BasicBlockListType;
@@ -113,13 +119,13 @@ public:
void buildCFG();
void controlFlowAnalysis();
void newRegArg(ICODE *picode, ICODE *ticode);
protected:
protected:
// TODO: replace those with friend visitor ?
void propLongReg(Int loc_ident_idx, ID *pLocId);
void propLongStk(Int i, ID *pLocId);
void propLongGlb(Int i, ID *pLocId);
int checkBackwarLongDefs(int loc_ident_idx, ID *pLocId, int pLocId_idx);
int checkBackwarLongDefs(int loc_ident_idx, ID *pLocId, int pLocId_idx, Assignment &assign);
void structCases();
void findExps();
void genDU1();

View File

@@ -201,7 +201,7 @@ void inverseCondOp (COND_EXPR **);
/* Exported funcions from locident.c */
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);
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

@@ -335,7 +335,7 @@ struct ICODE
void ClrLlFlag(dword flag) {ic.ll.flg &= ~flag;}
void SetLlFlag(dword flag) {ic.ll.flg |= flag;}
dword GetLlFlag() {return ic.ll.flg;}
bool isLlFlag(dword flg) {return (ic.ll.flg&flg)==flg;}
bool isLlFlag(dword flg) {return (ic.ll.flg&flg)!=0;}
llIcode GetLlOpcode() const { return ic.ll.opcode; }
void writeIntComment(std::ostringstream &s);
@@ -364,16 +364,9 @@ public:
~CIcodeRec(); // Destructor
ICODE * addIcode(ICODE *pIcode);
ICODE * GetFirstIcode();
// ICODE * GetNextIcode(ICODE * pCurIcode);
boolT IsValid(ICODE * pCurIcode);
int GetNumIcodes();
void SetInBB(int start, int end, BB* pnewBB);
void SetImmediateOp(int ip, dword dw);
void SetLlFlag(int ip, dword flag);
void ClearLlFlag(int ip, dword flag);
dword GetLlFlag(int ip);
void SetLlInvalid(int ip, boolT fInv);
dword GetLlLabel(int ip);
llIcode GetLlOpcode(int ip);
bool labelSrch(dword target, dword &pIndex);