From e71c8051c323e61fde4beb21899e13613cec0054 Mon Sep 17 00:00:00 2001 From: nemerle Date: Thu, 19 May 2016 10:27:15 +0200 Subject: [PATCH] Rename icodeType entries Following 2f80f16e6f76e3794ddc35ac9a6c1a86cb11cd28 --- include/Enums.h | 6 +++--- include/icode.h | 8 ++++---- src/BasicBlock.cpp | 2 +- src/dataflow.cpp | 6 +++--- src/hlicode.cpp | 10 +++++----- src/icode.cpp | 4 ++-- src/parser.cpp | 10 +++++----- src/proplong.cpp | 6 +++--- src/scanner.cpp | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/Enums.h b/include/Enums.h index d7def3a..900d44e 100644 --- a/include/Enums.h +++ b/include/Enums.h @@ -90,9 +90,9 @@ enum eLLFlags /* Types of icodes */ enum icodeType { - NOT_SCANNED = 0, // not even scanned yet - LOW_LEVEL, // low-level icode - HIGH_LEVEL // high-level icode + NOT_SCANNED_ICODE = 0, // not even scanned yet + LOW_LEVEL_ICODE, // low-level icode + HIGH_LEVEL_ICODE // high-level icode }; diff --git a/include/icode.h b/include/icode.h index 3736371..62abb7b 100644 --- a/include/icode.h +++ b/include/icode.h @@ -474,8 +474,8 @@ public: bool operator()(ICODE *ic) {return (ic->type==TYPE) and (ic->valid());} bool operator()(ICODE &ic) {return (ic.type==TYPE) and ic.valid();} }; - static TypeFilter select_high_level; - static TypeAndValidFilter select_valid_high_level; + static TypeFilter select_high_level; + static TypeAndValidFilter select_valid_high_level; /* Def/Use of registers and stack variables */ struct DU_ICODE { @@ -577,7 +577,7 @@ public: // set this icode to be an assign void setAsgn(Expr *lhs, Expr *rhs) { - type=HIGH_LEVEL; + type=HIGH_LEVEL_ICODE; hlU()->setAsgn(lhs,rhs); } void setUnary(hlIcode op, Expr *_exp); @@ -594,7 +594,7 @@ public: { return hlU()->call.newStkArg(exp,opcode,pproc); } - ICODE() : m_ll(this),Parent(0),invalid(false),type(NOT_SCANNED),loc_ip(0) + ICODE() : m_ll(this),Parent(0),invalid(false),type(NOT_SCANNED_ICODE),loc_ip(0) { } public: diff --git a/src/BasicBlock.cpp b/src/BasicBlock.cpp index 6bedcb0..df03cd2 100644 --- a/src/BasicBlock.cpp +++ b/src/BasicBlock.cpp @@ -391,7 +391,7 @@ void BB::writeBB(QTextStream &ostr,int lev, Function * pProc, int *numLoc) for(ICODE &pHli : instructions) { - if ((pHli.type == HIGH_LEVEL) and ( pHli.valid() )) //TODO: use filtering range here. + if ((pHli.type == HIGH_LEVEL_ICODE) and ( pHli.valid() )) //TODO: use filtering range here. { QString line = pHli.hl()->write1HlIcode(pProc, numLoc); if (not line.isEmpty()) diff --git a/src/dataflow.cpp b/src/dataflow.cpp index 3931a81..11ae413 100644 --- a/src/dataflow.cpp +++ b/src/dataflow.cpp @@ -148,7 +148,7 @@ void Function::elimCondCodes () { llIcode useAtOp = llIcode(useAt->ll()->getOpcode()); use = useAt->ll()->flagDU.u; - if ((useAt->type != LOW_LEVEL) or ( not useAt->valid() ) or ( 0 == use )) + if ((useAt->type != LOW_LEVEL_ICODE) or ( not useAt->valid() ) or ( 0 == use )) continue; /* Find definition within the same basic block */ defAt=useAt; @@ -271,7 +271,7 @@ void Function::genLiveKtes () continue; // skip invalid BBs for(ICODE &insn : *pbb) { - if ((insn.type == HIGH_LEVEL) and ( insn.valid() )) + if ((insn.type == HIGH_LEVEL_ICODE) and ( insn.valid() )) { liveUse |= (insn.du.use - def); def |= insn.du.def; @@ -886,7 +886,7 @@ void BB::findBBExps(LOCAL_ID &locals,Function *fnc) numHlIcodes = 0; assert(&fnc->localId==&locals); // register(s) to be forward substituted */ - auto valid_and_highlevel = instructions | filtered(ICODE::TypeAndValidFilter()); + auto valid_and_highlevel = instructions | filtered(ICODE::TypeAndValidFilter()); for (auto picode = valid_and_highlevel.begin(); picode != valid_and_highlevel.end(); picode++) { ICODE &_ic(*picode); diff --git a/src/hlicode.cpp b/src/hlicode.cpp index 68e32c3..6f89dda 100644 --- a/src/hlicode.cpp +++ b/src/hlicode.cpp @@ -29,7 +29,7 @@ void ICODE::checkHlCall() /* Places the new HLI_CALL high-level operand in the high-level icode array */ void ICODE::newCallHl() { - type = HIGH_LEVEL; + type = HIGH_LEVEL_ICODE; hlU()->setCall(ll()->src().proc.proc); if (ll()->src().proc.cb != 0) @@ -48,7 +48,7 @@ void ICODE::newCallHl() * array */ void ICODE::setUnary(hlIcode op, Expr *_exp) { - type = HIGH_LEVEL; + type = HIGH_LEVEL_ICODE; hlU()->set(op,_exp); } @@ -56,7 +56,7 @@ void ICODE::setUnary(hlIcode op, Expr *_exp) /* Places the new HLI_JCOND high-level operand in the high-level icode array */ void ICODE::setJCond(Expr *cexp) { - type = HIGH_LEVEL; + type = HIGH_LEVEL_ICODE; hlU()->set(HLI_JCOND,cexp); } @@ -320,7 +320,7 @@ void Function::highLevelGen() LLOperand *src_ll = ll->get(SRC); if ( ll->testFlags(NOT_HLL) ) pIcode->invalidate(); - if ((pIcode->type != LOW_LEVEL) or not pIcode->valid() ) + if ((pIcode->type != LOW_LEVEL_ICODE) or not pIcode->valid() ) continue; _flg = ll->getFlag(); if (not ll->testFlags(IM_OPS)) /* not processing IM_OPS yet */ @@ -353,7 +353,7 @@ void Function::highLevelGen() case iCALL: case iCALLF: - pIcode->type = HIGH_LEVEL; + pIcode->type = HIGH_LEVEL_ICODE; pIcode->hl( ll->createCall() ); break; diff --git a/src/icode.cpp b/src/icode.cpp index c62d8f1..0ed2408 100644 --- a/src/icode.cpp +++ b/src/icode.cpp @@ -9,8 +9,8 @@ #include -ICODE::TypeFilter ICODE::select_high_level; -ICODE::TypeAndValidFilter ICODE::select_valid_high_level; +ICODE::TypeFilter ICODE::select_high_level; +ICODE::TypeAndValidFilter ICODE::select_valid_high_level; CIcodeRec::CIcodeRec() { } diff --git a/src/parser.cpp b/src/parser.cpp index d3e40d1..1d91a15 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -42,7 +42,7 @@ ICODE * Function::translate_DIV(LLInst *ll, ICODE &_Icode) ICODE eIcode = ICODE(); - eIcode.type = LOW_LEVEL; + eIcode.type = LOW_LEVEL_ICODE; eIcode.ll()->set(iMOV,0,rTMP); if (ll->testFlags(B) ) { @@ -66,7 +66,7 @@ ICODE * Function::translate_DIV(LLInst *ll, ICODE &_Icode) /* iMOD */ eIcode = ICODE(); - eIcode.type = LOW_LEVEL; + eIcode.type = LOW_LEVEL_ICODE; eIcode.ll()->set(iMOD,ll->getFlag() | SYNTHETIC | IM_TMP_DST); eIcode.ll()->replaceSrc(_Icode.ll()->src()); eIcode.du = _Icode.du; @@ -77,7 +77,7 @@ ICODE *Function::translate_XCHG(LLInst *ll,ICODE &_Icode) { /* MOV rTMP, regDst */ ICODE eIcode; - eIcode.type = LOW_LEVEL; + eIcode.type = LOW_LEVEL_ICODE; eIcode.ll()->set(iMOV,SYNTHETIC,rTMP,ll->m_dst); eIcode.setRegDU( rTMP, eDEF); if(eIcode.ll()->src().getReg2()) @@ -97,7 +97,7 @@ ICODE *Function::translate_XCHG(LLInst *ll,ICODE &_Icode) /* MOV regSrc, rTMP */ eIcode = ICODE(); - eIcode.type = LOW_LEVEL; + eIcode.type = LOW_LEVEL_ICODE; eIcode.ll()->set(iMOV,SYNTHETIC); eIcode.ll()->replaceDst(ll->src()); if(eIcode.ll()->m_dst.regi) @@ -157,7 +157,7 @@ void Function::FollowCtrl(CALL_GRAPH * pcallGraph, STATE *pstate) iICODE labLoc = Icode.labelSrch(ll->label); if (Icode.end()!=labLoc) { /* Synthetic jump */ - _Icode.type = LOW_LEVEL; + _Icode.type = LOW_LEVEL_ICODE; ll->set(iJMP,I | SYNTHETIC | NO_OPS); ll->replaceSrc(LLOperand::CreateImm2(labLoc->ll()->GetLlLabel())); ll->label = SynthLab++; diff --git a/src/proplong.cpp b/src/proplong.cpp index 026e37b..779f1ad 100644 --- a/src/proplong.cpp +++ b/src/proplong.cpp @@ -248,7 +248,7 @@ void Function::propLongStk (int i, const ID &pLocId) next1 = ++iICODE(pIcode); if(next1==pEnd) break; - if ((pIcode->type == HIGH_LEVEL) or ( not pIcode->valid() )) + if ((pIcode->type == HIGH_LEVEL_ICODE) or ( not pIcode->valid() )) continue; if (pIcode->ll()->getOpcode() == next1->ll()->getOpcode()) { @@ -323,7 +323,7 @@ int Function::findBackwarLongDefs(int loc_ident_idx, const ID &pLocId, iICODE be ICODE &icode(*pIcode); - if ((icode.type == HIGH_LEVEL) or ( not icode.valid() )) + if ((icode.type == HIGH_LEVEL_ICODE) or ( not icode.valid() )) continue; if (icode.ll()->getOpcode() != next1->ll()->getOpcode()) continue; @@ -401,7 +401,7 @@ int Function::findForwardLongUses(int loc_ident_idx, const ID &pLocId, iICODE be LLOperand * pmH,* pmL; /* Pointers to dst LOW_LEVEL icodes */ int arc; - if ((pIcode->type == HIGH_LEVEL) or ( not pIcode->valid() )) + if ((pIcode->type == HIGH_LEVEL_ICODE) or ( not pIcode->valid() )) continue; if (pIcode->ll()->getOpcode() == next1->ll()->getOpcode()) diff --git a/src/scanner.cpp b/src/scanner.cpp index 374bb0f..56967b6 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -537,7 +537,7 @@ eErrorId scan(uint32_t ip, ICODE &p) PROG &prog(Project::get()->prog); int op; p = ICODE(); - p.type = LOW_LEVEL; + p.type = LOW_LEVEL_ICODE; p.ll()->label = ip; /* ip is absolute offset into image*/ if (ip >= (uint32_t)prog.cbImage) {