Add iInvalid enum value for invalid instructions

Various cleanups.
This commit is contained in:
nemerle
2017-02-13 13:24:54 +01:00
parent d7acc8cd4d
commit d6af9c1555
11 changed files with 584 additions and 594 deletions

View File

@@ -99,7 +99,7 @@ enum icodeType
/* LOW_LEVEL icode opcodes */
enum llIcode
{
//iINVALID,
iINVALID=-1,
iCBW, /* 0 */
iAAA,
iAAD,

View File

@@ -313,7 +313,7 @@ struct LLOperand
struct LLInst
{
protected:
uint32_t m_opcode; // Low level opcode identifier
llIcode m_opcode; // Low level opcode identifier
uint32_t flg; /* icode flags */
LLOperand m_src; /* source operand */
public:
@@ -326,8 +326,8 @@ public:
std::vector<uint32_t> caseTbl2;
int hllLabNum; /* label # for hll codegen */
uint32_t getOpcode() const { return m_opcode;}
void setOpcode(uint32_t op) { m_opcode=op; }
llIcode getOpcode() const { return m_opcode;}
void setOpcode(uint32_t op) { m_opcode=(llIcode)op; }
bool conditionalJump()
{
return (getOpcode() >= iJB) and (getOpcode() < iJCXZ);

View File

@@ -28,7 +28,7 @@ struct LLInst;
typedef std::list<ICODE>::iterator iICODE;
struct IDX_ARRAY : public std::vector<iICODE>
{
bool inList(iICODE idx)
bool inList(iICODE idx) const
{
return std::find(begin(),end(),idx)!=end();
}

View File

@@ -54,7 +54,7 @@ public:
ilFunction createFunction(FunctionType *f, const QString & name);
bool valid(ilFunction iter);
int getSymIdxByAdd(uint32_t adr);
int getSymIdxByAddr(uint32_t adr);
bool validSymIdx(size_t idx);
size_t symbolSize(size_t idx);
hlType symbolType(size_t idx);