}
/* Disassemble a complete basic block, starting at guest_IP_start,
- returning a new IRBB. The disassembler may chase across basic
+ returning a new IRSB. The disassembler may chase across basic
block boundaries if it wishes and if chase_into_ok allows it.
The precise guest address ranges from which code has been taken
are written into vge. guest_IP_bbstart is taken to be the IP in
preamble_function is a callback which allows the caller to add
its own IR preamble (following the self-check, if any). May be
- NULL. If non-NULL, the IRBB under construction is handed to
+ NULL. If non-NULL, the IRSB under construction is handed to
this function, which presumably adds IR statements to it. The
callback may optionally complete the block and direct bb_to_IR
not to disassemble any instructions into it; this is indicated
#include "libvex_basictypes.h"
-// Possible name changes?
-// - Tmp -> AssignTmp (Tmp statements only, not Tmp expressions)
-// - IRBB -> IRSB (superblock)? IRB? IRCB (code block)?
-// - dopyFoo -> copyFoo
-// - sopyFoo -> shallowCopyFoo (there's only one sopyFoo function)
-
-
/*---------------------------------------------------------------*/
/*--- High-level IR description ---*/
/*---------------------------------------------------------------*/
- deepCopyIRFoo is a deep copy constructor for IRFoos.
It recursively traverses the entire argument tree and
- produces a complete new tree.
+ produces a complete new tree. All types have a deep copy
+ constructor.
- shallowCopyIRFoo is the shallow copy constructor for IRFoos.
It creates a new top-level copy of the supplied object,
- but does not copy any sub-objects.
+ but does not copy any sub-objects. Only some types have a
+ shallow copy constructor.
*/
/* ------------------ Types ------------------ */
/* Forwards */
#if 0 /* UNUSED */
-static IRBB* ac_instrument ( IRBB*, VexGuestLayout*, IRType );
-static IRBB* mc_instrument ( IRBB*, VexGuestLayout*, IRType, IRType );
+static IRSB* ac_instrument ( IRSB*, VexGuestLayout*, IRType );
+static IRSB* mc_instrument ( IRSB*, VexGuestLayout*, IRType, IRType );
#endif
static Bool chase_into_not_ok ( void* opaque, Addr64 dst ) { return False; }
}
static
-IRBB* ac_instrument (IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRSB* ac_instrument (IRSB* bb_in, VexGuestLayout* layout, IRType hWordTy )
{
/* Use this rather than eg. -1 because it's a UInt. */
#define INVALID_DATA_SIZE 999999
Bool needSz;
/* Set up BB */
- IRBB* bb = emptyIRBB();
+ IRSB* bb = emptyIRSB();
bb->tyenv = dopyIRTypeEnv(bb_in->tyenv);
bb->next = dopyIRExpr(bb_in->next);
bb->jumpkind = bb_in->jumpkind;
needSz = True; break;
}
if (needSz) {
- addStmtToIRBB(
+ addStmtToIRSB(
bb,
IRStmt_Dirty(
unsafeIRDirty_0_N( helper->regparms,
mkIRExprVec_2(addr, mkIRExpr_HWord(sz)))
));
} else {
- addStmtToIRBB(
+ addStmtToIRSB(
bb,
IRStmt_Dirty(
unsafeIRDirty_0_N( helper->regparms,
needSz = True; break;
}
if (needSz) {
- addStmtToIRBB(
+ addStmtToIRSB(
bb,
IRStmt_Dirty(
unsafeIRDirty_0_N( helper->regparms,
mkIRExprVec_2(addr, mkIRExpr_HWord(sz)))
));
} else {
- addStmtToIRBB(
+ addStmtToIRSB(
bb,
IRStmt_Dirty(
unsafeIRDirty_0_N( helper->regparms,
panic("addrcheck: unhandled IRStmt");
}
- addStmtToIRBB( bb, dopyIRStmt(st));
+ addStmtToIRSB( bb, dopyIRStmt(st));
}
return bb;
typedef
struct _MCEnv {
/* MODIFIED: the bb being constructed. IRStmts are added. */
- IRBB* bb;
+ IRSB* bb;
/* MODIFIED: a table [0 .. #temps_in_original_bb-1] which maps
original temps to their current their current shadow temp.
/* assign value to tmp */
#define assign(_bb,_tmp,_expr) \
- addStmtToIRBB((_bb), IRStmt_Tmp((_tmp),(_expr)))
+ addStmtToIRSB((_bb), IRStmt_Tmp((_tmp),(_expr)))
/* add stmt to a bb */
#define stmt(_bb,_stmt) \
- addStmtToIRBB((_bb), (_stmt))
+ addStmtToIRSB((_bb), (_stmt))
/* build various kinds of expressions */
#define binop(_op, _arg1, _arg2) IRExpr_Binop((_op),(_arg1),(_arg2))
}
}
-IRBB* mc_instrument ( IRBB* bb_in, VexGuestLayout* layout,
+IRSB* mc_instrument ( IRSB* bb_in, VexGuestLayout* layout,
IRType gWordTy, IRType hWordTy )
{
Bool verboze = False; //True;
MCEnv mce;
/* Set up BB */
- IRBB* bb = emptyIRBB();
+ IRSB* bb = emptyIRSB();
bb->tyenv = dopyIRTypeEnv(bb_in->tyenv);
bb->next = dopyIRExpr(bb_in->next);
bb->jumpkind = bb_in->jumpkind;
VG_(printf)("\n");
}
- addStmtToIRBB(bb, st);
+ addStmtToIRSB(bb, st);
}