Browse Source

Rename icodeType entries

Following 2f80f16e6f76e3794ddc35ac9a6c1a86cb11cd28
nemerle 8 years ago
parent
commit
e71c8051c3
9 changed files with 27 additions and 27 deletions
  1. 3 3
      include/Enums.h
  2. 4 4
      include/icode.h
  3. 1 1
      src/BasicBlock.cpp
  4. 3 3
      src/dataflow.cpp
  5. 5 5
      src/hlicode.cpp
  6. 2 2
      src/icode.cpp
  7. 5 5
      src/parser.cpp
  8. 3 3
      src/proplong.cpp
  9. 1 1
      src/scanner.cpp

+ 3 - 3
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
 };
 
 

+ 4 - 4
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<HIGH_LEVEL> select_high_level;
-    static TypeAndValidFilter<HIGH_LEVEL> select_valid_high_level;
+    static TypeFilter<HIGH_LEVEL_ICODE> select_high_level;
+    static TypeAndValidFilter<HIGH_LEVEL_ICODE> 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:

+ 1 - 1
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())

+ 3 - 3
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<HIGH_LEVEL>());
+    auto valid_and_highlevel = instructions | filtered(ICODE::TypeAndValidFilter<HIGH_LEVEL_ICODE>());
     for (auto picode = valid_and_highlevel.begin(); picode != valid_and_highlevel.end(); picode++)
     {
         ICODE &_ic(*picode);

+ 5 - 5
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;
 

+ 2 - 2
src/icode.cpp

@@ -9,8 +9,8 @@
 
 #include <stdlib.h>
 
-ICODE::TypeFilter<HIGH_LEVEL> ICODE::select_high_level;
-ICODE::TypeAndValidFilter<HIGH_LEVEL> ICODE::select_valid_high_level;
+ICODE::TypeFilter<HIGH_LEVEL_ICODE> ICODE::select_high_level;
+ICODE::TypeAndValidFilter<HIGH_LEVEL_ICODE> ICODE::select_valid_high_level;
 CIcodeRec::CIcodeRec()
 {
 }

+ 5 - 5
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++;

+ 3 - 3
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())

+ 1 - 1
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)
     {