translated. */
static Addr32 guest_EIP_curr_instr;
-/* The IRSB* into which we're generating code. */
+/* The IRSB* into which we're generating code. All functions below work
+ implicitly with the main statement vector held by irsb->stmts. */
static IRSB* irsb;
#define R_GS 5
-/* Add a statement to the list held by "irbb". */
+/* Add a statement to the main statement vector held by "irbb->stmts". */
static void stmt ( IRStmt* st )
{
- addStmtToIRSB( irsb, st );
+ addStmtToIRStmtVec(irsb->stmts, st);
}
-/* Generate a new temporary of the given type. */
+/* Generate a new temporary of the given type.
+ Works only for the main IRStmtVec #0. */
static IRTemp newTemp ( IRType ty )
{
vassert(isPlausibleIRType(ty));
- return newIRTemp( irsb->tyenv, ty );
+ return newIRTemp(irsb->tyenv, irsb->stmts, ty);
}
/* Various simple conversions */
Int ccOp = ty==Ity_I8 ? 2 : (ty==Ity_I16 ? 1 : 0);
vassert(ty == Ity_I8 || ty == Ity_I16 || ty == Ity_I32);
- vassert(guard);
+ vassert(guard != IRTemp_INVALID);
/* Both kinds of right shifts are handled by the same thunk
operation. */
default:
vpanic("disAMode(x86)");
- return 0; /*notreached*/
}
}
mkU32(8 * sizeofIRType(ty)),
unop(Iop_Clz32, mkexpr(src32x))
));
-
IRTemp res = newTemp(ty);
assign(res, narrowTo(ty, mkexpr(res32)));
return res;
return t2;
}
vassert(0);
- /*NOTREACHED*/
- return IRTemp_INVALID;
}
/*------------------------------------------------------------*/
guest_EIP_curr_instr = (Addr32)guest_IP;
guest_EIP_bbstart = (Addr32)toUInt(guest_IP - delta);
- x1 = irsb_IN->stmts_used;
+ x1 = irsb_IN->stmts->stmts_used;
expect_CAS = False;
dres = disInstr_X86_WRK ( &expect_CAS, resteerOkFn,
resteerCisOk,
callback_opaque,
delta, archinfo, abiinfo, sigill_diag_IN );
- x2 = irsb_IN->stmts_used;
+ x2 = irsb_IN->stmts->stmts_used;
vassert(x2 >= x1);
/* See comment at the top of disInstr_X86_WRK for meaning of
IRCAS as directed by the returned expect_CAS value. */
has_CAS = False;
for (i = x1; i < x2; i++) {
- if (irsb_IN->stmts[i]->tag == Ist_CAS)
+ if (irsb_IN->stmts->stmts[i]->tag == Ist_CAS)
has_CAS = True;
}
callback_opaque,
delta, archinfo, abiinfo, sigill_diag_IN );
for (i = x1; i < x2; i++) {
- vex_printf("\t\t");
- ppIRStmt(irsb_IN->stmts[i]);
+ ppIRStmt(irsb_IN->stmts->stmts[i], irsb_IN->tyenv, 4);
vex_printf("\n");
}
/* Failure of this assertion is serious and denotes a bug in