Replace some tabs with spaces
This commit is contained in:
parent
152625d67d
commit
59c199837c
@ -241,7 +241,7 @@ struct GlobalVariable : public AstIdent
|
||||
struct GlobalVariableIdx : public AstIdent
|
||||
{
|
||||
bool valid;
|
||||
int idxGlbIdx; /* idx into localId, GLOB_VAR_IDX */
|
||||
int idxGlbIdx; /* idx into localId, GLOB_VAR_IDX */
|
||||
|
||||
virtual Expr *clone() const
|
||||
{
|
||||
@ -255,9 +255,9 @@ struct GlobalVariableIdx : public AstIdent
|
||||
struct Constant : public AstIdent
|
||||
{
|
||||
struct _kte
|
||||
{ /* for CONSTANT only */
|
||||
uint32_t kte; /* value of the constant */
|
||||
uint8_t size; /* #bytes size constant */
|
||||
{ /* for CONSTANT only */
|
||||
uint32_t kte; /* value of the constant */
|
||||
uint8_t size; /* #bytes size constant */
|
||||
} kte;
|
||||
|
||||
Constant(uint32_t _kte, uint8_t size)
|
||||
@ -276,7 +276,7 @@ struct Constant : public AstIdent
|
||||
};
|
||||
struct FuncNode : public AstIdent
|
||||
{
|
||||
struct _call { /* for FUNCTION only */
|
||||
struct _call { /* for FUNCTION only */
|
||||
Function *proc;
|
||||
STKFRAME *args;
|
||||
} call;
|
||||
@ -297,8 +297,8 @@ struct FuncNode : public AstIdent
|
||||
struct RegisterNode : public AstIdent
|
||||
{
|
||||
const LOCAL_ID *m_syms;
|
||||
regType regiType; /* for REGISTER only */
|
||||
int regiIdx; /* index into localId, REGISTER */
|
||||
regType regiType; /* for REGISTER only */
|
||||
int regiIdx; /* index into localId, REGISTER */
|
||||
|
||||
virtual Expr *insertSubTreeReg(Expr *_expr, eReg regi, const LOCAL_ID *locsym);
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ public:
|
||||
};
|
||||
|
||||
extern bundle cCode;
|
||||
#define lineSize 360 /* 3 lines in the mean time */
|
||||
#define lineSize 360 /* 3 lines in the mean time */
|
||||
|
||||
//void newBundle (bundle *procCode);
|
||||
void writeBundle (QIODevice & ios, bundle procCode);
|
||||
|
||||
@ -23,11 +23,11 @@
|
||||
#include "BasicBlock.h"
|
||||
class Project;
|
||||
/* CALL GRAPH NODE */
|
||||
extern bundle cCode; /* Output C procedure's declaration and code */
|
||||
extern bundle cCode; /* Output C procedure's declaration and code */
|
||||
|
||||
/**** Global variables ****/
|
||||
|
||||
extern QString asm1_name, asm2_name; /* Assembler output filenames */
|
||||
extern QString asm1_name, asm2_name; /* Assembler output filenames */
|
||||
|
||||
typedef struct { /* Command line option flags */
|
||||
unsigned verbose : 1;
|
||||
@ -38,7 +38,7 @@ typedef struct { /* Command line option flags */
|
||||
unsigned Stats : 1;
|
||||
unsigned Interact : 1; /* Interactive mode */
|
||||
unsigned Calls : 1; /* Follow register indirect calls */
|
||||
QString filename; /* The input filename */
|
||||
QString filename; /* The input filename */
|
||||
uint32_t CustomEntryPoint;
|
||||
} OPTION;
|
||||
|
||||
@ -60,13 +60,13 @@ enum eAreaType
|
||||
/* Intermediate instructions statistics */
|
||||
struct STATS
|
||||
{
|
||||
int numBBbef; /* number of basic blocks initially */
|
||||
int numBBaft; /* number of basic blocks at the end */
|
||||
int nOrder; /* n-th order */
|
||||
int numLLIcode; /* number of low-level Icode instructions */
|
||||
int numHLIcode; /* number of high-level Icode instructions */
|
||||
int totalLL; /* total number of low-level Icode insts */
|
||||
int totalHL; /* total number of high-level Icod insts */
|
||||
int numBBbef; /* number of basic blocks initially */
|
||||
int numBBaft; /* number of basic blocks at the end */
|
||||
int nOrder; /* n-th order */
|
||||
int numLLIcode; /* number of low-level Icode instructions */
|
||||
int numHLIcode; /* number of high-level Icode instructions */
|
||||
int totalLL; /* total number of low-level Icode insts */
|
||||
int totalHL; /* total number of high-level Icod insts */
|
||||
};
|
||||
|
||||
extern STATS stats; /* Icode statistics */
|
||||
|
||||
@ -29,7 +29,7 @@ using namespace std;
|
||||
#define POS_LAB 15 /* Position of label */
|
||||
#define POS_OPC 20 /* Position of opcode */
|
||||
#define POS_OPR 25 /* Position of operand */
|
||||
#define WID_PTR 10 /* Width of the "xword ptr" lingo */
|
||||
#define WID_PTR 10 /* Width of the "xword ptr" lingo */
|
||||
#define POS_OPR2 POS_OPR+WID_PTR /* Position of operand after "xword ptr" */
|
||||
#define POS_CMT 54 /* Position of comment */
|
||||
|
||||
@ -108,7 +108,7 @@ static vector<POSSTACK_ENTRY> posStack; /* position stack */
|
||||
|
||||
#define printfd(x) printf(x)
|
||||
#define dis_newline() printf("\n")
|
||||
#define dis_show() // Nothing to do unless using Curses
|
||||
#define dis_show() // Nothing to do unless using Curses
|
||||
|
||||
|
||||
void LLInst::findJumpTargets(CIcodeRec &_pc)
|
||||
@ -134,9 +134,9 @@ void LLInst::findJumpTargets(CIcodeRec &_pc)
|
||||
}
|
||||
/*****************************************************************************
|
||||
* disassem - Prints a disassembled listing of a procedure.
|
||||
* pass == 1 generates output on file .a1
|
||||
* pass == 2 generates output on file .a2
|
||||
* pass == 3 generates output on file .b
|
||||
* pass == 1 generates output on file .a1
|
||||
* pass == 2 generates output on file .a2
|
||||
* pass == 3 generates output on file .b
|
||||
****************************************************************************/
|
||||
|
||||
void Disassembler::disassem(PtrFunction ppProc)
|
||||
@ -551,7 +551,7 @@ void Disassembler::dis1Line(LLInst &inst,int loc_ip, int pass)
|
||||
/* output to .b code buffer */
|
||||
if (inst.testFlags(SYNTHETIC))
|
||||
result_stream<<";Synthetic inst";
|
||||
if (pass == 3) { /* output to .b code buffer */
|
||||
if (pass == 3) { /* output to .b code buffer */
|
||||
cCode.appendCode("%s\n", qPrintable(result_contents));
|
||||
}
|
||||
|
||||
@ -564,7 +564,7 @@ void Disassembler::dis1Line(LLInst &inst,int loc_ip, int pass)
|
||||
{
|
||||
sprintf(buf,"%03d %06X",loc_ip, inst.label);
|
||||
}
|
||||
else /* SYNTHETIC instruction */
|
||||
else /* SYNTHETIC instruction */
|
||||
{
|
||||
sprintf(buf,"%03d ",loc_ip);
|
||||
result_stream<<";Synthetic inst";
|
||||
@ -636,7 +636,7 @@ QTextStream &LLInst::strSrc(QTextStream &os,bool skip_comma)
|
||||
os<<", ";
|
||||
if (testFlags(I))
|
||||
os<<strHex(src().getImm2());
|
||||
else if (testFlags(IM_SRC)) /* level 2 */
|
||||
else if (testFlags(IM_SRC)) /* level 2 */
|
||||
os<<"dx:ax";
|
||||
else
|
||||
formatRM(os, src());
|
||||
|
||||
@ -190,7 +190,7 @@ void fixWildCards(uint8_t pat[])
|
||||
op = pat[pc++];
|
||||
if (pc >= PATLEN) return;
|
||||
|
||||
quad = (uint8_t) (op & 0xC0); /* Quadrant of the opcode map */
|
||||
quad = (uint8_t) (op & 0xC0); /* Quadrant of the opcode map */
|
||||
if (quad == 0)
|
||||
{
|
||||
/* Arithmetic group 00-3F */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*****************************************************************************
|
||||
* dcc project CFG related functions
|
||||
* dcc project CFG related functions
|
||||
* (C) Cristina Cifuentes
|
||||
****************************************************************************/
|
||||
|
||||
@ -47,7 +47,7 @@ void Function::createCFG()
|
||||
|
||||
BB * psBB;
|
||||
BB * pBB;
|
||||
iICODE pIcode = Icode.begin();
|
||||
iICODE pIcode = Icode.begin();
|
||||
|
||||
stats.numBBbef = stats.numBBaft = 0;
|
||||
rICODE current_range=make_iterator_range(pIcode,++iICODE(pIcode));
|
||||
@ -205,7 +205,7 @@ void Function::freeCFG()
|
||||
void Function::compressCFG()
|
||||
{
|
||||
BB *pNxt;
|
||||
int ip, first=0, last;
|
||||
int ip, first=0, last;
|
||||
|
||||
/* First pass over BB list removes redundant jumps of the form
|
||||
* (Un)Conditional -> Unconditional jump */
|
||||
@ -241,7 +241,7 @@ void Function::compressCFG()
|
||||
{
|
||||
if (pBB->inEdges.empty())
|
||||
{
|
||||
if (entry_node) /* Init it misses out on */
|
||||
if (entry_node) /* Init it misses out on */
|
||||
pBB->index = UN_INIT;
|
||||
else
|
||||
{
|
||||
@ -321,7 +321,7 @@ BB *BB::rmJMP(int marker, BB * pBB)
|
||||
****************************************************************************/
|
||||
void BB::mergeFallThrough( CIcodeRec &Icode)
|
||||
{
|
||||
BB * pChild;
|
||||
BB * pChild;
|
||||
if (nullptr==this)
|
||||
{
|
||||
printf("mergeFallThrough on empty BB!\n");
|
||||
@ -374,7 +374,7 @@ void BB::mergeFallThrough( CIcodeRec &Icode)
|
||||
****************************************************************************/
|
||||
void BB::dfsNumbering(std::vector<BB *> &dfsLast, int *first, int *last)
|
||||
{
|
||||
BB * pChild;
|
||||
BB * pChild;
|
||||
traversed = DFS_NUM;
|
||||
dfsFirstNum = (*first)++;
|
||||
|
||||
|
||||
@ -520,7 +520,7 @@ QString writeJcond (const HLTYPE &h, Function * pProc, int *numLoc)
|
||||
|
||||
/* Displays the inverse output of a HLI_JCOND icode. This is used in the case
|
||||
* when the THEN clause of an if..then..else is empty. The clause is
|
||||
* negated and the ELSE clause is used instead. */
|
||||
* negated and the ELSE clause is used instead. */
|
||||
QString writeJcondInv(HLTYPE h, Function * pProc, int *numLoc)
|
||||
{
|
||||
QString _form;
|
||||
@ -559,10 +559,11 @@ void HLTYPE::set(Expr *l, Expr *r)
|
||||
asgn.m_lhs=l;
|
||||
asgn.m_rhs=r;
|
||||
}
|
||||
/* Returns a string with the contents of the current high-level icode.
|
||||
* Note: this routine does not output the contens of HLI_JCOND icodes. This is
|
||||
* done in a separate routine to be able to support the removal of
|
||||
* empty THEN clauses on an if..then..else. */
|
||||
/** Returns a string with the contents of the current high-level icode.
|
||||
* \note this routine does not output the contens of HLI_JCOND icodes. This is
|
||||
* done in a separate routine to be able to support the removal of
|
||||
* empty THEN clauses on an if..then..else.
|
||||
*/
|
||||
QString HLTYPE::write1HlIcode (Function * pProc, int *numLoc) const
|
||||
{
|
||||
const HlTypeSupport *p = get();
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
|
||||
#include "msvc_fixes.h"
|
||||
#include "dcc.h"
|
||||
#include "types.h" // Common types like uint8_t, etc
|
||||
#include "ast.h" // Some icode types depend on these
|
||||
#include "types.h" // Common types like uint8_t, etc
|
||||
#include "ast.h" // Some icode types depend on these
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@ -53,8 +53,8 @@ int Idiom1::checkStkVars (iICODE pIcode)
|
||||
****************************************************************************/
|
||||
bool Idiom1::match(iICODE picode)
|
||||
{
|
||||
//uint8_t type = 0; /* type of variable: 1 = reg-var, 2 = local */
|
||||
//uint8_t regi; /* register of the MOV */
|
||||
//uint8_t type = 0; /* type of variable: 1 = reg-var, 2 = local */
|
||||
//uint8_t regi; /* register of the MOV */
|
||||
if(m_func->flg & PROC_HLL)
|
||||
return false;
|
||||
if(picode==m_end)
|
||||
@ -109,10 +109,10 @@ bool Idiom1::match(iICODE picode)
|
||||
m_min_off = 2 + (n * 2);
|
||||
}
|
||||
else
|
||||
return false; // Cristina: check this please!
|
||||
return false; // Cristina: check this please!
|
||||
}
|
||||
else
|
||||
return false; // Cristina: check this please!
|
||||
return false; // Cristina: check this please!
|
||||
}
|
||||
}
|
||||
else // push di [push si] / push si [push di]
|
||||
|
||||
@ -204,8 +204,8 @@ int LOCAL_ID::newLongReg(hlType t, const LONGID_TYPE &longT, iICODE ix_)
|
||||
id_arr.back().idx.push_back(ix_);
|
||||
return (id_arr.size() - 1);
|
||||
}
|
||||
/* Returns an identifier conditional expression node of type TYPE_LONG or
|
||||
* TYPE_WORD_SIGN */
|
||||
/** Returns an identifier conditional expression node of type TYPE_LONG or
|
||||
* TYPE_WORD_SIGN */
|
||||
AstIdent * LOCAL_ID::createId(const ID *retVal, iICODE ix_)
|
||||
{
|
||||
return AstIdent::idID(retVal,this,ix_);
|
||||
|
||||
@ -47,7 +47,7 @@ static const QString szOps[] =
|
||||
"RCL", "RCR", "ROL", "ROR", "RET", "RETF", "SAHF", "SAR",
|
||||
"SHL", "SHR", "SBB", "SCAS", "REPNE SCAS","REPE SCAS", "CWD", "STC",
|
||||
"STD", "STI", "STOS", "REP STOS", "SUB", "TEST", "WAIT", "XCHG",
|
||||
"XLAT", "XOR", "INTO", "NOP", "REPNE", "REPE", "MOD"
|
||||
"XLAT", "XOR", "INTO", "NOP", "REPNE", "REPE", "MOD"
|
||||
};
|
||||
/* The following opcodes are for mod != 3 */
|
||||
static const QString szFlops1[] =
|
||||
|
||||
@ -802,7 +802,7 @@ bool Function::process_CALL(ICODE & pIcode, CALL_GRAPH * pcallGraph, STATE *psta
|
||||
|
||||
/* return ((p->flg & TERMINATES) != 0); */
|
||||
}
|
||||
return false; // Cristina, please check!!
|
||||
return false; // Cristina, please check!!
|
||||
}
|
||||
|
||||
|
||||
@ -1020,7 +1020,7 @@ static void setBits(int16_t type, uint32_t start, uint32_t len)
|
||||
for (i = start + len - 1; i >= start; i--)
|
||||
{
|
||||
prog.map[i >> 2] |= type << ((i & 3) << 1);
|
||||
if (i == 0) break; // Fixes inf loop!
|
||||
if (i == 0) break; // Fixes inf loop!
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1181,8 +1181,8 @@ void Function::process_operands(ICODE & pIcode, STATE * pstate)
|
||||
|
||||
case iXCHG:
|
||||
/* This instruction is replaced by 3 instructions, only need
|
||||
* to define the src operand and use the destination operand
|
||||
* in the mean time. */
|
||||
* to define the src operand and use the destination operand
|
||||
* in the mean time.*/
|
||||
use(SRC, pIcode, this, pstate, cb);
|
||||
def(DST, pIcode, this, pstate, cb);
|
||||
break;
|
||||
|
||||
@ -97,7 +97,7 @@ void LOCAL_ID::newRegArg(iICODE picode, iICODE ticode) const
|
||||
condId type;
|
||||
Function * tproc;
|
||||
eReg regL = rUNDEF;
|
||||
eReg regH; /* Registers involved in arguments */
|
||||
eReg regH; /* Registers involved in arguments */
|
||||
|
||||
/* Flag ticode as having register arguments */
|
||||
tproc = ticode->hl()->call.proc;
|
||||
@ -245,7 +245,7 @@ bool CallType::newStkArg(Expr *exp, llIcode opcode, Function * pproc)
|
||||
|
||||
|
||||
/* Places the actual argument exp in the position given by pos in the
|
||||
* argument list of picode. */
|
||||
* argument list of picode. */
|
||||
void CallType::placeStkArg (Expr *exp, int pos)
|
||||
{
|
||||
(*args)[pos].actual = exp;
|
||||
@ -289,7 +289,7 @@ Expr *Function::adjustActArgType (Expr *_exp, hlType forType)
|
||||
case TYPE_STR:
|
||||
switch (actType) {
|
||||
case TYPE_CONST:
|
||||
/* It's an offset into image where a string is found. Point to the string. */
|
||||
/* It's an offset into image where a string is found. Point to the string. */
|
||||
{
|
||||
Constant *c=dynamic_cast<Constant *>(expr);
|
||||
assert(c);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user