From: Julian Seward Date: Mon, 15 Nov 2004 14:22:12 +0000 (+0000) Subject: Rename INVALID_IRTEMP to IRTemp_INVALID to be consistent with X-Git-Tag: svn/VALGRIND_3_0_1^2~779 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a54ff960d313d128549426fecf344c9cd808a500;p=thirdparty%2Fvalgrind.git Rename INVALID_IRTEMP to IRTemp_INVALID to be consistent with other *_INVALID symbols. git-svn-id: svn://svn.valgrind.org/vex/trunk@555 --- diff --git a/VEX/head20041019/coregrind/vg_translate.c b/VEX/head20041019/coregrind/vg_translate.c index 5530737787..6f0bfa8c79 100644 --- a/VEX/head20041019/coregrind/vg_translate.c +++ b/VEX/head20041019/coregrind/vg_translate.c @@ -1391,7 +1391,7 @@ IRBB* vg_SP_update_pass ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) bb->next = dopyIRExpr(bb_in->next); bb->jumpkind = bb_in->jumpkind; - IRTemp curr = INVALID_IRTEMP; + IRTemp curr = IRTemp_INVALID; Long delta = 0; Int sizeof_SP = layout->sizeof_SP; diff --git a/VEX/head20041019/memcheck/mc_translate.c b/VEX/head20041019/memcheck/mc_translate.c index e405875045..f610ca8676 100644 --- a/VEX/head20041019/memcheck/mc_translate.c +++ b/VEX/head20041019/memcheck/mc_translate.c @@ -102,7 +102,7 @@ typedef static IRTemp findShadowTmp ( MCEnv* mce, IRTemp orig ) { sk_assert(orig < mce->n_originalTmps); - if (mce->tmpMap[orig] == INVALID_IRTEMP) { + if (mce->tmpMap[orig] == IRTemp_INVALID) { mce->tmpMap[orig] = newIRTemp(mce->bb->tyenv, shadowType(mce->bb->tyenv->types[orig])); @@ -1394,7 +1394,7 @@ void do_shadow_Dirty ( MCEnv* mce, IRDirty* d ) results to all destinations. */ /* Outputs: the destination temporary, if there is one. */ - if (d->tmp != INVALID_IRTEMP) { + if (d->tmp != IRTemp_INVALID) { dst = findShadowTmp(mce, d->tmp); tyDst = typeOfIRTemp(mce->bb->tyenv, d->tmp); assign( mce->bb, dst, mkPCastTo( mce, tyDst, curr) ); @@ -1535,7 +1535,7 @@ IRBB* SK_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) mce.hWordTy = hWordTy; mce.tmpMap = LibVEX_Alloc(mce.n_originalTmps * sizeof(IRTemp)); for (i = 0; i < mce.n_originalTmps; i++) - mce.tmpMap[i] = INVALID_IRTEMP; + mce.tmpMap[i] = IRTemp_INVALID; /* Iterate over the stmts. */ diff --git a/VEX/priv/guest-x86/toIR.c b/VEX/priv/guest-x86/toIR.c index 74146d0270..31177a476d 100644 --- a/VEX/priv/guest-x86/toIR.c +++ b/VEX/priv/guest-x86/toIR.c @@ -1852,7 +1852,7 @@ UInt dis_op2_E_G ( UChar sorb, IRTemp src = newTemp(ty); IRTemp dst0 = newTemp(ty); UChar rm = getUChar(delta0); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; /* addSubCarry == True indicates the intended operation is add-with-carry or subtract-with-borrow. */ @@ -1961,7 +1961,7 @@ UInt dis_op2_G_E ( UChar sorb, IRTemp src = newTemp(ty); IRTemp dst0 = newTemp(ty); UChar rm = getIByte(delta0); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; /* addSubCarry == True indicates the intended operation is add-with-carry or subtract-with-borrow. */ @@ -2294,7 +2294,7 @@ UInt dis_Grp1 ( UChar sorb, IRTemp dst1 = newTemp(ty); IRTemp src = newTemp(ty); IRTemp dst0 = newTemp(ty); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; IROp op8 = Iop_INVALID; UInt mask = sz==1 ? 0xFF : (sz==2 ? 0xFFFF : 0xFFFFFFFF); @@ -2378,7 +2378,7 @@ UInt dis_Grp2 ( UChar sorb, IRType ty = szToITy(sz); IRTemp dst0 = newTemp(ty); IRTemp dst1 = newTemp(ty); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; vassert(sz == 1 || sz == 2 || sz == 4); @@ -2773,7 +2773,7 @@ UInt dis_Grp3 ( UChar sorb, Int sz, UInt delta ) IRTemp addr; IRType ty = szToITy(sz); IRTemp t1 = newTemp(ty); - // IRTemp t2 = INVALID_IRTEMP; + // IRTemp t2 = IRTemp_INVALID; IRTemp dst1, src, dst0; modrm = getIByte(delta); if (epartIsReg(modrm)) { @@ -2958,10 +2958,10 @@ UInt dis_Grp5 ( UChar sorb, Int sz, UInt delta, DisResult* whatNext ) Int len; UChar modrm; UChar dis_buf[50]; - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; IRType ty = szToITy(sz); IRTemp t1 = newTemp(ty); - IRTemp t2 = INVALID_IRTEMP; + IRTemp t2 = IRTemp_INVALID; modrm = getIByte(delta); if (epartIsReg(modrm)) { @@ -4877,11 +4877,11 @@ UInt dis_SHLRD_Gv_Ev ( UChar sorb, IRType ty = szToITy(sz); IRTemp gsrc = newTemp(ty); IRTemp esrc = newTemp(ty); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; IRTemp tmpSH = newTemp(Ity_I8); - IRTemp tmpL = INVALID_IRTEMP; - IRTemp tmpRes = INVALID_IRTEMP; - IRTemp tmpSubSh = INVALID_IRTEMP; + IRTemp tmpL = IRTemp_INVALID; + IRTemp tmpRes = IRTemp_INVALID; + IRTemp tmpSubSh = IRTemp_INVALID; IROp mkpair; IROp getres; IROp shift; @@ -5007,7 +5007,7 @@ UInt dis_bt_G_E ( UChar sorb, Int sz, UInt delta, BtOp op ) vassert(sz == 2 || sz == 4); t_fetched = t_bitno0 = t_bitno1 = t_bitno2 - = t_addr0 = t_addr1 = t_esp = t_mask = INVALID_IRTEMP; + = t_addr0 = t_addr1 = t_esp = t_mask = IRTemp_INVALID; t_fetched = newTemp(Ity_I8); t_bitno0 = newTemp(Ity_I32); @@ -5304,7 +5304,7 @@ UInt dis_cmpxchg_G_E ( UChar sorb, IRTemp dest2 = newTemp(ty); IRTemp acc2 = newTemp(ty); IRTemp cond8 = newTemp(Ity_I8); - IRTemp addr = INVALID_IRTEMP; + IRTemp addr = IRTemp_INVALID; UChar rm = getUChar(delta0); if (epartIsReg(rm)) { @@ -6245,8 +6245,8 @@ static DisResult disInstr ( /*IN*/ Bool resteerOK, assert. */ *size = 0; - addr = t1 = t2 = INVALID_IRTEMP; - //t3 = t4 = INVALID_IRTEMP; + addr = t1 = t2 = IRTemp_INVALID; + //t3 = t4 = IRTemp_INVALID; DIP("\t0x%x: ", guest_eip_bbstart+delta); diff --git a/VEX/priv/host-x86/isel.c b/VEX/priv/host-x86/isel.c index 98e8d5d348..77681c74e4 100644 --- a/VEX/priv/host-x86/isel.c +++ b/VEX/priv/host-x86/isel.c @@ -2365,7 +2365,7 @@ static void iselStmt ( ISelEnv* env, IRStmt* stmt ) doHelperCall( env, passBBP, d->guard, d->cee, d->args ); /* Now figure out what to do with the returned value, if any. */ - if (d->tmp == INVALID_IRTEMP) + if (d->tmp == IRTemp_INVALID) /* No return value. Nothing to do. */ return; diff --git a/VEX/priv/ir/irdefs.c b/VEX/priv/ir/irdefs.c index 7fdb14e915..7001f31650 100644 --- a/VEX/priv/ir/irdefs.c +++ b/VEX/priv/ir/irdefs.c @@ -94,8 +94,8 @@ void ppIRArray ( IRArray* arr ) void ppIRTemp ( IRTemp tmp ) { - if (tmp == INVALID_IRTEMP) - vex_printf("INVALID_IRTEMP"); + if (tmp == IRTemp_INVALID) + vex_printf("IRTemp_INVALID"); else vex_printf( "t%d", (Int)tmp); } @@ -314,7 +314,7 @@ void ppIREffect ( IREffect fx ) void ppIRDirty ( IRDirty* d ) { Int i; - if (d->tmp != INVALID_IRTEMP) { + if (d->tmp != IRTemp_INVALID) { ppIRTemp(d->tmp); vex_printf(" = "); } @@ -662,7 +662,7 @@ IRDirty* emptyIRDirty ( void ) { d->cee = NULL; d->guard = NULL; d->args = NULL; - d->tmp = INVALID_IRTEMP; + d->tmp = IRTemp_INVALID; d->mFx = Ifx_None; d->mAddr = NULL; d->mSize = 0; @@ -1569,7 +1569,7 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy ) if (d->guard == NULL) goto bad_dirty; if (typeOfIRExpr(tyenv, d->guard) != Ity_Bit) sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_Bit"); - if (d->tmp != INVALID_IRTEMP + if (d->tmp != IRTemp_INVALID && typeOfIRTemp(tyenv, d->tmp) == Ity_Bit) sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_Bit"); for (i = 0; d->args[i] != NULL; i++) { @@ -1642,7 +1642,7 @@ void sanityCheckIRBB ( IRBB* bb, IRType guest_word_size ) } else if (stmt->tag == Ist_Dirty - && stmt->Ist.Dirty.details->tmp != INVALID_IRTEMP) { + && stmt->Ist.Dirty.details->tmp != IRTemp_INVALID) { IRDirty* d = stmt->Ist.Dirty.details; if (d->tmp < 0 || d->tmp >= n_temps) sanityCheckFail(bb, stmt, diff --git a/VEX/priv/ir/iropt.c b/VEX/priv/ir/iropt.c index f64e3d9ead..37cf8d1663 100644 --- a/VEX/priv/ir/iropt.c +++ b/VEX/priv/ir/iropt.c @@ -2939,7 +2939,7 @@ static void deltaIRStmt ( IRStmt* st, Int delta ) deltaIRExpr(d->guard, delta); for (i = 0; d->args[i]; i++) deltaIRExpr(d->args[i], delta); - if (d->tmp != INVALID_IRTEMP) + if (d->tmp != IRTemp_INVALID) d->tmp += delta; if (d->mAddr) deltaIRExpr(d->mAddr, delta); diff --git a/VEX/pub/libvex_ir.h b/VEX/pub/libvex_ir.h index 9ef49fd915..bc58c380af 100644 --- a/VEX/pub/libvex_ir.h +++ b/VEX/pub/libvex_ir.h @@ -155,7 +155,7 @@ typedef UInt IRTemp; extern void ppIRTemp ( IRTemp ); -#define INVALID_IRTEMP ((IRTemp)0xFFFFFFFF) +#define IRTemp_INVALID ((IRTemp)0xFFFFFFFF) /* ------------------ Binary and unary ops ------------------ */ @@ -557,7 +557,7 @@ typedef IRCallee* cee; /* where to call */ IRExpr* guard; /* :: Ity_Bit. Controls whether call happens */ IRExpr** args; /* arg list, ends in NULL */ - IRTemp tmp; /* to assign result to, or INVALID_IRTEMP if none */ + IRTemp tmp; /* to assign result to, or IRTemp_INVALID if none */ /* Mem effects; we allow only one R/W/M region to be stated */ IREffect mFx; /* indicates memory effects, if any */ diff --git a/VEX/test_main.c b/VEX/test_main.c index a51995ab37..6aa4368e34 100644 --- a/VEX/test_main.c +++ b/VEX/test_main.c @@ -424,7 +424,7 @@ typedef Shadow IRTemps are therefore allocated on demand. mce.tmpMap is a table indexed [0 .. n_types-1], which gives the current shadow for - each original tmp, or INVALID_IRTEMP if none is so far assigned. + each original tmp, or IRTemp_INVALID if none is so far assigned. It is necessary to support making multiple assignments to a shadow -- specifically, after testing a shadow for definedness, it needs to be made defined. But IR's SSA property disallows this. @@ -434,7 +434,7 @@ typedef that, and the tmpMap is updated to reflect the new binding. A corollary is that if the tmpMap maps a given tmp to - INVALID_IRTEMP and we are hoping to read that shadow tmp, it means + IRTemp_INVALID and we are hoping to read that shadow tmp, it means there's a read-before-write error in the original tmps. The IR sanity checker should catch all such anomalies, however. */ @@ -444,7 +444,7 @@ typedef static IRTemp findShadowTmp ( MCEnv* mce, IRTemp orig ) { sk_assert(orig < mce->n_originalTmps); - if (mce->tmpMap[orig] == INVALID_IRTEMP) { + if (mce->tmpMap[orig] == IRTemp_INVALID) { mce->tmpMap[orig] = newIRTemp(mce->bb->tyenv, shadowType(mce->bb->tyenv->types[orig])); @@ -1736,7 +1736,7 @@ void do_shadow_Dirty ( MCEnv* mce, IRDirty* d ) results to all destinations. */ /* Outputs: the destination temporary, if there is one. */ - if (d->tmp != INVALID_IRTEMP) { + if (d->tmp != IRTemp_INVALID) { dst = findShadowTmp(mce, d->tmp); tyDst = typeOfIRTemp(mce->bb->tyenv, d->tmp); assign( mce->bb, dst, mkPCastTo( mce, tyDst, curr) ); @@ -1877,7 +1877,7 @@ IRBB* mc_instrument ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) mce.hWordTy = hWordTy; mce.tmpMap = LibVEX_Alloc(mce.n_originalTmps * sizeof(IRTemp)); for (i = 0; i < mce.n_originalTmps; i++) - mce.tmpMap[i] = INVALID_IRTEMP; + mce.tmpMap[i] = IRTemp_INVALID; /* Iterate over the stmts. */