changed temporary ICODE buffer in disassem.cpp from ICODE * to CIcodeRec

This commit is contained in:
Artur K 2011-12-12 21:54:56 +01:00
parent cd040363e6
commit 5c55f990b7
4 changed files with 10 additions and 10 deletions

View File

@ -170,7 +170,7 @@ void BackEnd(char *filename, CALL_GRAPH *); /* backend.c */
char *cChar(byte c); /* backend.c */ char *cChar(byte c); /* backend.c */
Int scan(dword ip, ICODE * p); /* scanner.c */ Int scan(dword ip, ICODE * p); /* scanner.c */
void parse (CALL_GRAPH * *); /* parser.c */ void parse (CALL_GRAPH * *); /* parser.c */
boolT labelSrch(ICODE * pIc, Int n, dword tg, Int *pIdx); /* parser.c */ boolT labelSrch(CIcodeRec &pIc, Int n, dword tg, Int *pIdx); /* parser.c */
Int strSize (byte *, char); /* parser.c */ Int strSize (byte *, char); /* parser.c */
void disassem(Int pass, Function * pProc); /* disassem.c */ void disassem(Int pass, Function * pProc); /* disassem.c */
void interactDis(Function * initProc, Int initIC); /* disassem.c */ void interactDis(Function * initProc, Int initIC); /* disassem.c */

View File

@ -573,7 +573,7 @@ static boolT xClear (COND_EXPR *rhs, Int f, Int t, Int lastBBinst, Function * pp
case IDENTIFIER: case IDENTIFIER:
if (rhs->expr.ident.idType == REGISTER) if (rhs->expr.ident.idType == REGISTER)
{ {
picode = pproc->Icode.GetFirstIcode(); picode = &pproc->Icode.front();
regi= pproc->localId.id_arr[rhs->expr.ident.idNode.regiIdx].id.regi; regi= pproc->localId.id_arr[rhs->expr.ident.idNode.regiIdx].id.regi;
for (i = (f + 1); (i < lastBBinst) && (i < t); i++) for (i = (f + 1); (i < lastBBinst) && (i < t); i++)
if ((picode[i].type == HIGH_LEVEL) && if ((picode[i].type == HIGH_LEVEL) &&
@ -703,8 +703,7 @@ void Function::findExps()
(ticode->ic.hl.opcode != HLI_RET))) (ticode->ic.hl.opcode != HLI_RET)))
continue; continue;
if (xClear (picode->ic.hl.oper.asgn.rhs, j, if (xClear (picode->ic.hl.oper.asgn.rhs, j, picode->du1.idx[0][0], lastInst, this))
picode->du1.idx[0][0], lastInst, this))
{ {
switch (ticode->ic.hl.opcode) { switch (ticode->ic.hl.opcode) {
case HLI_ASSIGN: case HLI_ASSIGN:

View File

@ -138,7 +138,7 @@ static void flops(ICODE * pi);
boolT callArg(word off, char *temp); /* Check for procedure name */ boolT callArg(word off, char *temp); /* Check for procedure name */
static FILE *fp; static FILE *fp;
static ICODE * pc; static CIcodeRec pc;
static char buf[200], *p; static char buf[200], *p;
static Int cb, j, numIcode, allocIcode, eop; static Int cb, j, numIcode, allocIcode, eop;
static vector<int> pl; static vector<int> pl;
@ -199,10 +199,10 @@ void disassem(Int pass, Function * ppProc)
fatalError(CANNOT_OPEN, p); fatalError(CANNOT_OPEN, p);
} }
} }
pc=pProc->Icode;
/* Create temporary code array */ /* Create temporary code array */
// Mike: needs objectising! // Mike: needs objectising!
pc = (ICODE *)memcpy(allocMem(cb), pProc->Icode.GetFirstIcode(), (size_t)cb); //pc = (ICODE *)memcpy(allocMem(cb), pProc->Icode.GetFirstIcode(), (size_t)cb);
if (pass == 1) if (pass == 1)
{ {
@ -249,7 +249,7 @@ void disassem(Int pass, Function * ppProc)
fclose(fp); fclose(fp);
} }
free(pc); pc.clear();
destroySymTables(); destroySymTables();
} }

View File

@ -687,7 +687,8 @@ static hlType cbType[] = {TYPE_UNKNOWN, TYPE_BYTE_UNSIGN, TYPE_WORD_SIGN,
* is checked and updated if the old size was less than the new size (ie. * is checked and updated if the old size was less than the new size (ie.
* the maximum size is always saved). */ * the maximum size is always saved). */
static SYM * updateGlobSym (dword operand, Int size, word duFlag) static SYM * updateGlobSym (dword operand, Int size, word duFlag)
{ Int i; {
Int i;
/* Check for symbol in symbol table */ /* Check for symbol in symbol table */
for (i = 0; i < symtab.csym; i++) for (i = 0; i < symtab.csym; i++)
@ -849,7 +850,7 @@ void STATE::setState(word reg, int16 value)
/* labelSrchRepl - Searches Icode for instruction with label = target, and /* labelSrchRepl - Searches Icode for instruction with label = target, and
replaces *pIndex with an icode index */ replaces *pIndex with an icode index */
boolT labelSrch(ICODE *pIcode, Int numIp, dword target, Int *pIndex) boolT labelSrch(CIcodeRec &pIcode, Int numIp, dword target, Int *pIndex)
{ {
Int i; Int i;