]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename the boolean field in IRStmt_Exit from 'cond' to 'guard' to be
authorJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 15:30:21 +0000 (15:30 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 15:30:21 +0000 (15:30 +0000)
consistent with other places where boolean guards are stored.

git-svn-id: svn://svn.valgrind.org/vex/trunk@557

VEX/head20041019/addrcheck/ac_main.c
VEX/head20041019/memcheck/mc_translate.c
VEX/priv/host-x86/isel.c
VEX/priv/ir/irdefs.c
VEX/priv/ir/iropt.c
VEX/pub/libvex_ir.h
VEX/test_main.c

index 3fd356a5173928e3987f0755ea32241065f6669b..70cd1d4a5c8d7b09511e77f4c6e0d33938f0b844 100644 (file)
@@ -1010,7 +1010,7 @@ IRBB* SK_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
             break;
 
          case Ist_Exit:
-            sk_assert(isAtom(st->Ist.Exit.cond));
+            sk_assert(isAtom(st->Ist.Exit.guard));
             break;
 
          case Ist_Dirty:
index aec5e6d8c42bf51a9d0477506a1decb723c1d13e..f60deeb5d1587e7b84d611ec7f67c7e7646cfd36 100644 (file)
@@ -1592,7 +1592,7 @@ IRBB* SK_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
 
          case Ist_Exit:
             /* if (!hasBogusLiterals) */
-               complainIfUndefined( &mce, st->Ist.Exit.cond );
+               complainIfUndefined( &mce, st->Ist.Exit.guard );
             break;
 
          case Ist_Dirty:
index d78b18990f949fe3dd1925c1656114249bcf1098..09d635895da7a5a3bdee142870182af2df671eb9 100644 (file)
@@ -2396,7 +2396,7 @@ static void iselStmt ( ISelEnv* env, IRStmt* stmt )
       if (stmt->Ist.Exit.dst->tag != Ico_U32)
          vpanic("isel_x86: Ist_Exit: dst is not a 32-bit value");
       dst = iselIntExpr_RI(env, IRExpr_Const(stmt->Ist.Exit.dst));
-      cc  = iselCondCode(env,stmt->Ist.Exit.cond);
+      cc  = iselCondCode(env,stmt->Ist.Exit.guard);
       addInstr(env, X86Instr_Goto(Ijk_Boring, cc, dst));
       return;
    }
index c555609a4a17ad0053ad321ea619e99869b06f88..b43f6dc472574cda8e1ad61f46671a3b4150055e 100644 (file)
@@ -377,7 +377,7 @@ void ppIRStmt ( IRStmt* s )
          break;
       case Ist_Exit:
          vex_printf( "if (" );
-         ppIRExpr(s->Ist.Exit.cond);
+         ppIRExpr(s->Ist.Exit.guard);
          vex_printf( ") goto ");
          ppIRConst(s->Ist.Exit.dst);
          break;
@@ -712,11 +712,11 @@ IRStmt* IRStmt_Dirty ( IRDirty* d )
    s->Ist.Dirty.details = d;
    return s;
 }
-IRStmt* IRStmt_Exit ( IRExpr* cond, IRConst* dst ) {
-   IRStmt* s        = LibVEX_Alloc(sizeof(IRStmt));
-   s->tag           = Ist_Exit;
-   s->Ist.Exit.cond = cond;
-   s->Ist.Exit.dst  = dst;
+IRStmt* IRStmt_Exit ( IRExpr* guard, IRConst* dst ) {
+   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
+   s->tag            = Ist_Exit;
+   s->Ist.Exit.guard = guard;
+   s->Ist.Exit.dst   = dst;
    return s;
 }
 
@@ -885,7 +885,7 @@ IRStmt* dopyIRStmt ( IRStmt* s )
       case Ist_Dirty: 
          return IRStmt_Dirty(dopyIRDirty(s->Ist.Dirty.details));
       case Ist_Exit: 
-         return IRStmt_Exit(dopyIRExpr(s->Ist.Exit.cond), 
+         return IRStmt_Exit(dopyIRExpr(s->Ist.Exit.guard), 
                             dopyIRConst(s->Ist.Exit.dst));
       default: 
          vpanic("dopyIRStmt");
@@ -1253,7 +1253,7 @@ Bool isFlatIRStmt ( IRStmt* st )
             return False;
          return True;
       case Ist_Exit:
-         return isAtom(st->Ist.Exit.cond);
+         return isAtom(st->Ist.Exit.guard);
       default: 
          vpanic("isFlatIRStmt(st)");
    }
@@ -1398,7 +1398,7 @@ void useBeforeDef_Stmt ( IRBB* bb, IRStmt* stmt, Int* def_counts )
             useBeforeDef_Expr(bb,stmt,d->mAddr,def_counts);
          break;
       case Ist_Exit:
-         useBeforeDef_Expr(bb,stmt,stmt->Ist.Exit.cond,def_counts);
+         useBeforeDef_Expr(bb,stmt,stmt->Ist.Exit.guard,def_counts);
          break;
       default: 
          vpanic("useBeforeDef_Stmt");
@@ -1583,9 +1583,9 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy )
          sanityCheckFail(bb,stmt,"IRStmt.Dirty: ill-formed");
 
       case Ist_Exit:
-         tcExpr( bb, stmt, stmt->Ist.Exit.cond, gWordTy );
-         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.cond) != Ity_I1)
-            sanityCheckFail(bb,stmt,"IRStmt.Exit.cond: not :: Ity_I1");
+         tcExpr( bb, stmt, stmt->Ist.Exit.guard, gWordTy );
+         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.guard) != Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.Exit.guard: not :: Ity_I1");
          if (typeOfIRConst(stmt->Ist.Exit.dst) != gWordTy)
             sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: not :: guest word type");
          break;
index 126b1516f44218781dd40c7ce892d39cd83ae0c3..1cb1973abfa2d7b5598b586d8a22af4bdb814af6 100644 (file)
@@ -327,7 +327,7 @@ static void flatten_Stmt ( IRBB* bb, IRStmt* st )
          addStmtToIRBB(bb, IRStmt_Dirty(d2));
          break;
       case Ist_Exit:
-         e1 = flatten_Expr(bb, st->Ist.Exit.cond);
+         e1 = flatten_Expr(bb, st->Ist.Exit.guard);
          addStmtToIRBB(bb, IRStmt_Exit(e1, st->Ist.Exit.dst));
          break;
       default:
@@ -839,8 +839,8 @@ static IRStmt* subst_and_fold_Stmt ( IRExpr** env, IRStmt* st )
 
       case Ist_Exit: {
          IRExpr* fcond;
-         vassert(isAtom(st->Ist.Exit.cond));
-         fcond = fold_Expr(subst_Expr(env, st->Ist.Exit.cond));
+         vassert(isAtom(st->Ist.Exit.guard));
+         fcond = fold_Expr(subst_Expr(env, st->Ist.Exit.guard));
          if (fcond->tag == Iex_Const) {
             /* Interesting.  The condition on this exit has folded down to
                a constant. */
@@ -1021,7 +1021,7 @@ static void addUses_Stmt ( Bool* set, IRStmt* st )
             addUses_Expr(set, d->args[i]);
          return;
       case Ist_Exit:
-         addUses_Expr(set, st->Ist.Exit.cond);
+         addUses_Expr(set, st->Ist.Exit.guard);
          return;
       default:
          vex_printf("\n");
@@ -1322,7 +1322,7 @@ static void handle_gets_Stmt (
          break;
 
       case Ist_Exit:
-         vassert(isAtom(st->Ist.Exit.cond));
+         vassert(isAtom(st->Ist.Exit.guard));
          break;
 
       case Ist_PutI:
@@ -1398,7 +1398,7 @@ static void redundant_put_removal_BB (
             out the set, since we can no longer claim that the next
             event for any part of the guest state is definitely a
             write. */
-         vassert(isAtom(st->Ist.Exit.cond));
+         vassert(isAtom(st->Ist.Exit.guard));
          for (j = 0; j < env->used; j++)
             env->inuse[j] = False;
          continue;
@@ -1611,7 +1611,7 @@ static void occCount_Stmt ( TmpInfo** env, IRStmt* st )
             occCount_Expr(env, d->args[i]);
          return;
       case Ist_Exit:
-         occCount_Expr(env, st->Ist.Exit.cond);
+         occCount_Expr(env, st->Ist.Exit.guard);
          return;
       default: 
          vex_printf("\n"); ppIRStmt(st); vex_printf("\n");
@@ -1736,7 +1736,7 @@ static IRStmt* tbSubst_Stmt ( TmpInfo** env, IRStmt* st )
 
       case Ist_Exit:
          return IRStmt_Exit(
-                   tbSubst_Expr(env, st->Ist.Exit.cond),
+                   tbSubst_Expr(env, st->Ist.Exit.guard),
                    st->Ist.Exit.dst
                 );
       case Ist_Dirty:
@@ -2928,7 +2928,7 @@ static void deltaIRStmt ( IRStmt* st, Int delta )
          deltaIRExpr(st->Ist.Tmp.data, delta);
          break;
       case Ist_Exit:
-         deltaIRExpr(st->Ist.Exit.cond, delta);
+         deltaIRExpr(st->Ist.Exit.guard, delta);
          break;
       case Ist_STle:
          deltaIRExpr(st->Ist.STle.addr, delta);
@@ -3133,7 +3133,8 @@ static IRBB* maybe_loop_unroll_BB ( IRBB* bb0, Addr64 my_addr )
    }
 
    /* negate the test condition */
-   st->Ist.Exit.cond = IRExpr_Unop(Iop_Not1,dopyIRExpr(st->Ist.Exit.cond));
+   st->Ist.Exit.guard 
+      = IRExpr_Unop(Iop_Not1,dopyIRExpr(st->Ist.Exit.guard));
 
    /* --- The unroller proper.  Both idioms are by now --- */
    /* --- now converted to idiom 1. --- */
@@ -3278,7 +3279,7 @@ static Bool hasGetIorPutI ( IRBB* bb )
             vassert(isAtom(st->Ist.STle.data));
             break;
          case Ist_Exit:
-            vassert(isAtom(st->Ist.Exit.cond));
+            vassert(isAtom(st->Ist.Exit.guard));
             break;
          case Ist_Dirty:
             d = st->Ist.Dirty.details;
index a2628be90c15f7da9f72c4a91ef9e4a658d7aa6b..9feb773584247aef273c8e1ec99a63788644e83a 100644 (file)
@@ -638,7 +638,7 @@ typedef
             IRDirty* details;
          } Dirty;
          struct {
-            IRExpr*  cond;
+            IRExpr*  guard;
             IRConst* dst;
          } Exit;
       } Ist;
@@ -651,7 +651,7 @@ extern IRStmt* IRStmt_PutI  ( IRArray* descr, IRExpr* ix, Int bias,
 extern IRStmt* IRStmt_Tmp   ( IRTemp tmp, IRExpr* data );
 extern IRStmt* IRStmt_STle  ( IRExpr* addr, IRExpr* data );
 extern IRStmt* IRStmt_Dirty ( IRDirty* details );
-extern IRStmt* IRStmt_Exit  ( IRExpr* cond, IRConst* dst );
+extern IRStmt* IRStmt_Exit  ( IRExpr* guard, IRConst* dst );
 
 extern IRStmt* dopyIRStmt ( IRStmt* );
 
index b33456406b8747d73c1af7256718fa5f5f93a3fd..2e5fd30ae99bad8a45d16edb4cc026b1a58f9034 100644 (file)
@@ -287,7 +287,7 @@ IRBB* ac_instrument (IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
             break;
 
          case Ist_Exit:
-            assert(isAtom(st->Ist.Exit.cond));
+            assert(isAtom(st->Ist.Exit.guard));
             break;
 
          case Ist_Dirty:
@@ -1843,7 +1843,7 @@ static Bool checkForBogusLiterals ( /*FLAT*/ IRStmt* st )
          return isBogusAtom(st->Ist.STle.addr) 
                 || isBogusAtom(st->Ist.STle.data);
       case Ist_Exit:
-         return isBogusAtom(st->Ist.Exit.cond);
+         return isBogusAtom(st->Ist.Exit.guard);
       default: 
       unhandled:
          ppIRStmt(st);
@@ -1934,7 +1934,7 @@ IRBB* mc_instrument ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
 
          case Ist_Exit:
             /* if (!hasBogusLiterals) */
-               complainIfUndefined( &mce, st->Ist.Exit.cond );
+               complainIfUndefined( &mce, st->Ist.Exit.guard );
             break;
 
          case Ist_Dirty: