llvm -
This commit is contained in:
parent
a51c5af87f
commit
95ec23eceb
@ -273,7 +273,7 @@ struct HLTYPE
|
||||
} oper; /* operand */
|
||||
} ;
|
||||
/* LOW_LEVEL icode operand record */
|
||||
struct LLOpcode : public llvm::MCOperand
|
||||
struct LLOperand //: public llvm::MCOperand
|
||||
{
|
||||
byte seg; /* CS, DS, ES, SS */
|
||||
int16 segValue; /* Value of segment seg during analysis */
|
||||
@ -282,12 +282,10 @@ struct LLOpcode : public llvm::MCOperand
|
||||
int16 off; /* memory address offset */
|
||||
dword opz; /* idx of immed src op */
|
||||
//union {/* Source operand if (flg & I) */
|
||||
//dword opz; /* idx of immed src op */
|
||||
struct { /* Call & # actual arg bytes */
|
||||
Function *proc; /* pointer to target proc (for CALL(F))*/
|
||||
int cb; /* # actual arg bytes */
|
||||
} proc;
|
||||
//} immed;
|
||||
dword op() const {return opz;}
|
||||
void SetImmediateOp(dword dw) {opz=dw;}
|
||||
|
||||
@ -298,8 +296,8 @@ struct LLInst : public llvm::MCInst
|
||||
byte numBytes; /* Number of bytes this instr */
|
||||
flags32 flg; /* icode flags */
|
||||
dword label; /* offset in image (20-bit adr) */
|
||||
LLOpcode dst; /* destination operand */
|
||||
LLOpcode src; /* source operand */
|
||||
LLOperand dst; /* destination operand */
|
||||
LLOperand src; /* source operand */
|
||||
DU flagDU; /* def/use of flags */
|
||||
struct { /* Case table if op==JMP && !I */
|
||||
Int numEntries; /* # entries in case table */
|
||||
|
||||
@ -350,7 +350,7 @@ COND_EXPR *COND_EXPR::id(const ICODE &pIcode, opLoc sd, Function * pProc, Int i,
|
||||
|
||||
Int idx; /* idx into pIcode->localId table */
|
||||
|
||||
const LLOpcode &pm((sd == SRC) ? pIcode.ic.ll.src : pIcode.ic.ll.dst);
|
||||
const LLOperand &pm((sd == SRC) ? pIcode.ic.ll.src : pIcode.ic.ll.dst);
|
||||
|
||||
if ( ((sd == DST) && pIcode.ic.ll.anyFlagSet(IM_DST)) or
|
||||
((sd == SRC) && pIcode.ic.ll.anyFlagSet(IM_SRC)) or
|
||||
@ -434,7 +434,7 @@ COND_EXPR *COND_EXPR::id(const ICODE &pIcode, opLoc sd, Function * pProc, Int i,
|
||||
/* Returns the identifier type */
|
||||
condId ICODE::idType(opLoc sd)
|
||||
{
|
||||
LLOpcode &pm((sd == SRC) ? ic.ll.src : ic.ll.dst);
|
||||
LLOperand &pm((sd == SRC) ? ic.ll.src : ic.ll.dst);
|
||||
|
||||
if ((sd == SRC) && ((ic.ll.flg & I) == I))
|
||||
return (CONSTANT);
|
||||
|
||||
@ -129,8 +129,8 @@ static const char *szPtr[2] = { "word ptr ", "byte ptr " };
|
||||
|
||||
static void dis1Line (Int i, Int pass);
|
||||
void dis1LineOp(Int i, boolT fWin, char attr, word *len, Function * pProc);
|
||||
static void formatRM(ostringstream &p, flags32 flg, LLOpcode *pm);
|
||||
static ostringstream &strDst(ostringstream &os, flags32 flg, LLOpcode *pm);
|
||||
static void formatRM(ostringstream &p, flags32 flg, LLOperand *pm);
|
||||
static ostringstream &strDst(ostringstream &os, flags32 flg, LLOperand *pm);
|
||||
static ostringstream &strSrc(ostringstream &os, ICODE *pc, bool skip_comma=false);
|
||||
static char *strHex(dword d);
|
||||
static Int checkScanned(dword pcCur);
|
||||
@ -599,7 +599,7 @@ static void dis1Line(Int i, Int pass)
|
||||
/****************************************************************************
|
||||
* formatRM
|
||||
***************************************************************************/
|
||||
static void formatRM(std::ostringstream &p, flags32 flg, LLOpcode *pm)
|
||||
static void formatRM(std::ostringstream &p, flags32 flg, LLOperand *pm)
|
||||
{
|
||||
char seg[4];
|
||||
|
||||
@ -646,7 +646,7 @@ static void formatRM(std::ostringstream &p, flags32 flg, LLOpcode *pm)
|
||||
/*****************************************************************************
|
||||
* strDst
|
||||
****************************************************************************/
|
||||
static ostringstream & strDst(ostringstream &os,flags32 flg, LLOpcode *pm)
|
||||
static ostringstream & strDst(ostringstream &os,flags32 flg, LLOperand *pm)
|
||||
{
|
||||
/* Immediates to memory require size descriptor */
|
||||
//os << setw(WID_PTR);
|
||||
|
||||
@ -457,7 +457,7 @@ static boolT idiom6 (iICODE pIcode, iICODE pEnd)
|
||||
****************************************************************************/
|
||||
static boolT idiom7 (iICODE pIcode)
|
||||
{
|
||||
LLOpcode *dst, *src;
|
||||
LLOperand *dst, *src;
|
||||
|
||||
dst = &pIcode->ic.ll.dst;
|
||||
src = &pIcode->ic.ll.src;
|
||||
@ -497,7 +497,7 @@ static boolT idiom7 (iICODE pIcode)
|
||||
****************************************************************************/
|
||||
static boolT idiom21 (iICODE picode, iICODE pend)
|
||||
{
|
||||
LLOpcode *dst, *src;
|
||||
LLOperand *dst, *src;
|
||||
|
||||
dst = &picode->ic.ll.dst;
|
||||
src = &picode->ic.ll.src;
|
||||
|
||||
@ -252,7 +252,7 @@ Int LOCAL_ID::newLongStk(hlType t, Int offH, Int offL)
|
||||
Int LOCAL_ID::newLong(opLoc sd, ICODE *pIcode, hlFirst f, Int ix,operDu du, Int off)
|
||||
{
|
||||
Int idx;
|
||||
LLOpcode *pmH, *pmL;
|
||||
LLOperand *pmH, *pmL;
|
||||
|
||||
if (f == LOW_FIRST)
|
||||
{
|
||||
@ -308,7 +308,7 @@ Int LOCAL_ID::newLong(opLoc sd, ICODE *pIcode, hlFirst f, Int ix,operDu du, Int
|
||||
boolT checkLongEq (LONG_STKID_TYPE longId, iICODE pIcode, Int i, Int idx,
|
||||
Function * pProc, COND_EXPR **rhs, COND_EXPR **lhs, Int off)
|
||||
{
|
||||
LLOpcode *pmHdst, *pmLdst, *pmHsrc, *pmLsrc; /* pointers to LOW_LEVEL icodes */
|
||||
LLOperand *pmHdst, *pmLdst, *pmHsrc, *pmLsrc; /* pointers to LOW_LEVEL icodes */
|
||||
|
||||
pmHdst = &pIcode->ic.ll.dst;
|
||||
pmLdst = &(pIcode+off)->ic.ll.dst;
|
||||
@ -346,7 +346,7 @@ boolT checkLongEq (LONG_STKID_TYPE longId, iICODE pIcode, Int i, Int idx,
|
||||
boolT checkLongRegEq (LONGID_TYPE longId, iICODE pIcode, Int i, Int idx,
|
||||
Function * pProc, COND_EXPR *&rhs, COND_EXPR *&lhs, Int off)
|
||||
{
|
||||
LLOpcode *pmHdst, *pmLdst, *pmHsrc, *pmLsrc; /* pointers to LOW_LEVEL icodes */
|
||||
LLOperand *pmHdst, *pmLdst, *pmHsrc, *pmLsrc; /* pointers to LOW_LEVEL icodes */
|
||||
|
||||
pmHdst = &pIcode->ic.ll.dst;
|
||||
pmLdst = &(pIcode+off)->ic.ll.dst;
|
||||
|
||||
@ -21,7 +21,7 @@ static void process_operands(ICODE * pIcode, Function * pProc, STATE * pstat
|
||||
static void setBits(int16 type, dword start, dword len);
|
||||
static SYM * updateGlobSym(dword operand, Int size, word duFlag);
|
||||
static void process_MOV(ICODE * pIcode, STATE * pstate);
|
||||
static SYM * lookupAddr (LLOpcode *pm, STATE * pstate, Int size, word duFlag);
|
||||
static SYM * lookupAddr (LLOperand *pm, STATE * pstate, Int size, word duFlag);
|
||||
void interactDis(Function * initProc, Int ic);
|
||||
static dword SynthLab;
|
||||
|
||||
@ -777,7 +777,7 @@ static void updateFrameOff (STKFRAME * ps, int16 off, Int size, word duFlag)
|
||||
* if necessary.
|
||||
* Returns a pointer to the symbol in the
|
||||
* symbol table, or Null if it's not a direct memory offset. */
|
||||
static SYM * lookupAddr (LLOpcode *pm, STATE *pstate, Int size, word duFlag)
|
||||
static SYM * lookupAddr (LLOperand *pm, STATE *pstate, Int size, word duFlag)
|
||||
{
|
||||
Int i;
|
||||
SYM * psym;
|
||||
@ -912,7 +912,7 @@ dword duReg[] = { 0x00,
|
||||
* ix : current index into icode array */
|
||||
static void use (opLoc d, ICODE * pIcode, Function * pProc, STATE * pstate, Int size, Int ix)
|
||||
{
|
||||
LLOpcode * pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
LLOperand * pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
SYM * psym;
|
||||
|
||||
if (pm->regi == 0 || pm->regi >= INDEXBASE)
|
||||
@ -959,7 +959,7 @@ static void use (opLoc d, ICODE * pIcode, Function * pProc, STATE * pstate, Int
|
||||
static void def (opLoc d, ICODE * pIcode, Function * pProc, STATE * pstate, Int size,
|
||||
Int ix)
|
||||
{
|
||||
LLOpcode *pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
LLOperand *pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
SYM * psym;
|
||||
|
||||
if (pm->regi == 0 || pm->regi >= INDEXBASE)
|
||||
@ -1011,7 +1011,7 @@ static void def (opLoc d, ICODE * pIcode, Function * pProc, STATE * pstate, Int
|
||||
static void use_def(opLoc d, ICODE * pIcode, Function * pProc, STATE * pstate, Int cb,
|
||||
Int ix)
|
||||
{
|
||||
LLOpcode * pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
LLOperand * pm = (d == SRC)? &pIcode->ic.ll.src: &pIcode->ic.ll.dst;
|
||||
|
||||
use (d, pIcode, pProc, pstate, cb, ix);
|
||||
|
||||
|
||||
@ -302,7 +302,7 @@ void checkBack();
|
||||
int Function::checkBackwarLongDefs(int loc_ident_idx, ID *pLocId, int pLocId_idx,Assignment &asgn)
|
||||
{
|
||||
int idx;
|
||||
LLOpcode * pmH,* pmL;
|
||||
LLOperand * pmH,* pmL;
|
||||
iICODE pIcode;
|
||||
for (idx = pLocId_idx - 1; idx > 0 ; idx--)
|
||||
{
|
||||
@ -397,7 +397,7 @@ void Function::propLongReg (Int loc_ident_idx, ID *pLocId)
|
||||
for (idx = pLocId_idx + 1; idx < Icode.size() - 1; idx++)
|
||||
{
|
||||
iICODE pIcode;
|
||||
LLOpcode * pmH,* pmL; /* Pointers to dst LOW_LEVEL icodes */
|
||||
LLOperand * pmH,* pmL; /* Pointers to dst LOW_LEVEL icodes */
|
||||
int off,arc;
|
||||
pIcode = Icode.begin()+(idx);
|
||||
if ((pIcode->type == HIGH_LEVEL) || (pIcode->invalid == TRUE))
|
||||
|
||||
@ -403,7 +403,7 @@ static Int signex(byte b)
|
||||
***************************************************************************/
|
||||
static void setAddress(Int i, boolT fdst, word seg, int16 reg, word off)
|
||||
{
|
||||
LLOpcode *pm;
|
||||
LLOperand *pm;
|
||||
|
||||
/* If not to register (i.e. to r/m), and talking about r/m,
|
||||
then this is dest */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user