Home | History | Annotate | Download | only in priv

Lines Matching defs:bb

1351 void ppIRSB ( IRSB* bb )
1355 ppIRTypeEnv(bb->tyenv);
1357 for (i = 0; i < bb->stmts_used; i++) {
1359 ppIRStmt(bb->stmts[i]);
1362 vex_printf( " PUT(%d) = ", bb->offsIP );
1363 ppIRExpr( bb->next );
1365 ppIRJumpKind(bb->jumpkind);
1845 IRSB* bb = LibVEX_Alloc(sizeof(IRSB));
1846 bb->tyenv = emptyIRTypeEnv();
1847 bb->stmts_used = 0;
1848 bb->stmts_size = 8;
1849 bb->stmts = LibVEX_Alloc(bb->stmts_size * sizeof(IRStmt*));
1850 bb->next = NULL;
1851 bb->jumpkind = Ijk_Boring;
1852 bb->offsIP = 0;
1853 return bb;
2073 IRSB* deepCopyIRSB ( IRSB* bb )
2077 IRSB* bb2 = deepCopyIRSBExceptStmts(bb);
2078 bb2->stmts_used = bb2->stmts_size = bb->stmts_used;
2081 sts2[i] = deepCopyIRStmt(bb->stmts[i]);
2086 IRSB* deepCopyIRSBExceptStmts ( IRSB* bb )
2089 bb2->tyenv = deepCopyIRTypeEnv(bb->tyenv);
2090 bb2->next = deepCopyIRExpr(bb->next);
2091 bb2->jumpkind = bb->jumpkind;
2092 bb2->offsIP = bb->offsIP;
2863 void addStmtToIRSB ( IRSB* bb, IRStmt* st )
2866 if (bb->stmts_used == bb->stmts_size) {
2867 IRStmt** stmts2 = LibVEX_Alloc(2 * bb->stmts_size * sizeof(IRStmt*));
2868 for (i = 0; i < bb->stmts_size; i++)
2869 stmts2[i] = bb->stmts[i];
2870 bb->stmts = stmts2;
2871 bb->stmts_size *= 2;
2873 vassert(bb->stmts_used < bb->stmts_size);
2874 bb->stmts[bb->stmts_used] = st;
2875 bb->stmts_used++;
3117 The target address at the end of the BB is a 32- or 64-
3133 void sanityCheckFail ( IRSB* bb, IRStmt* stmt, HChar* what )
3136 ppIRSB(bb);
3184 void useBeforeDef_Temp ( IRSB* bb, IRStmt* stmt, IRTemp tmp, Int* def_counts )
3186 if (tmp < 0 || tmp >= bb->tyenv->types_used)
3187 sanityCheckFail(bb,stmt, "out of range Temp in IRExpr");
3189 sanityCheckFail(bb,stmt, "IRTemp use before def in IRExpr");
3193 void useBeforeDef_Expr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, Int* def_counts )
3200 useBeforeDef_Expr(bb,stmt,expr->Iex.GetI.ix,def_counts);
3203 useBeforeDef_Temp(bb,stmt,expr->Iex.RdTmp.tmp,def_counts);
3207 useBeforeDef_Expr(bb,stmt,qop->arg1,def_counts);
3208 useBeforeDef_Expr(bb,stmt,qop->arg2,def_counts);
3209 useBeforeDef_Expr(bb,stmt,qop->arg3,def_counts);
3210 useBeforeDef_Expr(bb,stmt,qop->arg4,def_counts);
3215 useBeforeDef_Expr(bb,stmt,triop->arg1,def_counts);
3216 useBeforeDef_Expr(bb,stmt,triop->arg2,def_counts);
3217 useBeforeDef_Expr(bb,stmt,triop->arg3,def_counts);
3221 useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg1,def_counts);
3222 useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg2,def_counts);
3225 useBeforeDef_Expr(bb,stmt,expr->Iex.Unop.arg,def_counts);
3228 useBeforeDef_Expr(bb,stmt,expr->Iex.Load.addr,def_counts);
3234 useBeforeDef_Expr(bb,stmt,expr->Iex.CCall.args[i],def_counts);
3237 useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.cond,def_counts);
3238 useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.expr0,def_counts);
3239 useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.exprX,def_counts);
3247 void useBeforeDef_Stmt ( IRSB* bb, IRStmt* stmt, Int* def_counts )
3257 useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.base,def_counts);
3258 useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.nia,def_counts);
3261 useBeforeDef_Expr(bb,stmt,stmt->Ist.Put.data,def_counts);
3265 useBeforeDef_Expr(bb,stmt,puti->ix,def_counts);
3266 useBeforeDef_Expr(bb,stmt,puti->data,def_counts);
3269 useBeforeDef_Expr(bb,stmt,stmt->Ist.WrTmp.data,def_counts);
3272 useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.addr,def_counts);
3273 useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.data,def_counts);
3277 useBeforeDef_Expr(bb,stmt,cas->addr,def_counts);
3279 useBeforeDef_Expr(bb,stmt,cas->expdHi,def_counts);
3280 useBeforeDef_Expr(bb,stmt,cas->expdLo,def_counts);
3282 useBeforeDef_Expr(bb,stmt,cas->dataHi,def_counts);
3283 useBeforeDef_Expr(bb,stmt,cas->dataLo,def_counts);
3286 useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.addr,def_counts);
3288 useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.storedata,def_counts);
3293 useBeforeDef_Expr(bb,stmt,d->args[i],def_counts);
3295 useBeforeDef_Expr(bb,stmt,d->mAddr,def_counts);
3301 useBeforeDef_Expr(bb,stmt,stmt->Ist.Exit.guard,def_counts);
3309 void tcExpr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, IRType gWordTy )
3313 IRTypeEnv* tyenv = bb->tyenv;
3319 tcExpr(bb,stmt, expr->Iex.GetI.ix, gWordTy );
3321 sanityCheckFail(bb,stmt,"IRExpr.GetI.ix: not :: Ity_I32");
3323 sanityCheckFail(bb,stmt,"IRExpr.GetI.descr: invalid descr");
3328 tcExpr(bb,stmt, qop->arg1, gWordTy );
3329 tcExpr(bb,stmt, qop->arg2, gWordTy );
3330 tcExpr(bb,stmt, qop->arg3, gWordTy );
3331 tcExpr(bb,stmt, qop->arg4, gWordTy );
3339 sanityCheckFail(bb,stmt,
3341 "... name of op precedes BB printout\n");
3371 sanityCheckFail(bb,stmt,
3373 "... additional details precede BB printout\n");
3380 tcExpr(bb,stmt, triop->arg1, gWordTy );
3381 tcExpr(bb,stmt, triop->arg2, gWordTy );
3382 tcExpr(bb,stmt, triop->arg3, gWordTy );
3390 sanityCheckFail(bb,stmt,
3392 "... name of op precedes BB printout\n");
3416 sanityCheckFail(bb,stmt,
3418 "... additional details precede BB printout\n");
3424 tcExpr(bb,stmt, expr->Iex.Binop.arg1, gWordTy );
3425 tcExpr(bb,stmt, expr->Iex.Binop.arg2, gWordTy );
3433 sanityCheckFail(bb,stmt,
3435 "... name of op precedes BB printout\n");
3454 sanityCheckFail(bb,stmt,
3456 "... additional details precede BB printout\n");
3461 tcExpr(bb,stmt, expr->Iex.Unop.arg, gWordTy );
3466 sanityCheckFail(bb,stmt,"Iex.Unop: wrong arity op");
3468 sanityCheckFail(bb,stmt,"Iex.Unop: arg ty doesn't match op ty");
3471 tcExpr(bb,stmt, expr->Iex.Load.addr, gWordTy);
3473 sanityCheckFail(bb,stmt,"Iex.Load.addr: not :: guest word type");
3475 sanityCheckFail(bb,stmt,"Iex.Load.end: bogus endianness");
3479 sanityCheckFail(bb,stmt,"Iex.CCall.cee: bad IRCallee");
3481 sanityCheckFail(bb,stmt,"Iex.CCall.cee: #regparms > #args");
3484 sanityCheckFail(bb,stmt,"Iex.CCall: > 32 args");
3485 tcExpr(bb,stmt, expr->Iex.CCall.args[i], gWordTy);
3488 sanityCheckFail(bb,stmt,"Iex.CCall.retty: cannot return :: Ity_I1");
3491 sanityCheckFail(bb,stmt,"Iex.CCall.arg: arg :: Ity_I1");
3495 sanityCheckFail(bb,stmt,"Iex.Const.con: invalid const");
3498 tcExpr(bb,stmt, expr->Iex.Mux0X.cond, gWordTy);
3499 tcExpr(bb,stmt, expr->Iex.Mux0X.expr0, gWordTy);
3500 tcExpr(bb,stmt, expr->Iex.Mux0X.exprX, gWordTy);
3502 sanityCheckFail(bb,stmt,"Iex.Mux0X.cond: cond :: Ity_I8");
3505 sanityCheckFail(bb,stmt,"Iex.Mux0X: expr0/exprX mismatch");
3514 void tcStmt ( IRSB* bb, IRStmt* stmt, IRType gWordTy )
3521 IRTypeEnv* tyenv = bb->tyenv;
3527 sanityCheckFail(bb,stmt,"IRStmt.IMark.len: implausible");
3529 sanityCheckFail(bb,stmt,"IRStmt.IMark.delta: implausible");
3533 sanityCheckFail(bb,stmt,"IRStmt.AbiHint.base: "
3536 sanityCheckFail(bb,stmt,"IRStmt.AbiHint.nia: "
3540 tcExpr( bb, stmt, stmt->Ist.Put.data, gWordTy );
3542 sanityCheckFail(bb,stmt,"IRStmt.Put.data: cannot Put :: Ity_I1");
3546 tcExpr( bb, stmt, puti->data, gWordTy );
3547 tcExpr( bb, stmt, puti->ix, gWordTy );
3549 sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_I1");
3552 sanityCheckFail(bb,stmt,"IRStmt.PutI.data: data ty != elem ty");
3554 sanityCheckFail(bb,stmt,"IRStmt.PutI.ix: not :: Ity_I32");
3556 sanityCheckFail(bb,stmt,"IRStmt.PutI.descr: invalid descr");
3559 tcExpr( bb, stmt, stmt->Ist.WrTmp.data, gWordTy );
3562 sanityCheckFail(bb,stmt,"IRStmt.Put.Tmp: tmp and expr do not match");
3565 tcExpr( bb, stmt, stmt->Ist.Store.addr, gWordTy );
3566 tcExpr( bb, stmt, stmt->Ist.Store.data, gWordTy );
3568 sanityCheckFail(bb,stmt,"IRStmt.Store.addr: not :: guest word type");
3570 sanityCheckFail(bb,stmt,"IRStmt.Store.data: cannot Store :: Ity_I1");
3572 sanityCheckFail(bb,stmt,"Ist.Store.end: bogus endianness");
3591 tcExpr( bb, stmt, cas->addr, gWordTy );
3622 sanityCheckFail(bb,stmt,"IRStmt.CAS: ill-formed");
3627 sanityCheckFail(bb,stmt,"IRStmt.LLSC.addr: not :: guest word type");
3629 sanityCheckFail(bb,stmt,"Ist.LLSC.end: bogus endianness");
3635 sanityCheckFail(bb,stmt,"Ist.LLSC(LL).result :: bogus");
3639 sanityCheckFail(bb,stmt,"Ist.LLSC(SC).result: not :: Ity_I1");
3643 sanityCheckFail(bb,stmt,
3680 tcExpr( bb, stmt, d->guard, gWordTy );
3682 sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_I1");
3690 sanityCheckFail(bb,stmt,"IRStmt.Dirty with a return value"
3695 sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_I1");
3698 sanityCheckFail(bb,stmt,"IRStmt.Dirty: > 32 args");
3700 sanityCheckFail(bb,stmt,"IRStmt.Dirty.arg[i] :: Ity_I1");
3704 sanityCheckFail(bb,stmt,"IRStmt.Dirty: ill-formed");
3712 default: sanityCheckFail(bb,stmt,"IRStmt.MBE.event: unknown");
3717 tcExpr( bb, stmt, stmt->Ist.Exit.guard, gWordTy );
3719 sanityCheckFail(bb,stmt,"IRStmt.Exit.guard: not :: Ity_I1");
3721 sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: bad dst");
3723 sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: not :: guest word type");
3726 sanityCheckFail(bb,stmt,"IRStmt.Exit.offsIP: too low");
3733 void sanityCheckIRSB ( IRSB* bb, HChar* caller,
3738 Int n_temps = bb->tyenv->types_used;
3747 if (bb->stmts_used < 0 || bb->stmts_size < 8
3748 || bb->stmts_used > bb->stmts_size)
3749 /* this BB is so strange we can't even print it */
3754 IRType ty = typeOfIRTemp(bb->tyenv,(IRTemp)i);
3758 sanityCheckFail(bb,NULL,"Temp declared with implausible type");
3764 for (i = 0; i < bb->stmts_used; i++) {
3765 stmt = bb->stmts[i];
3767 sanityCheckFail(bb, stmt, "IRStmt: is NULL");
3769 sanityCheckFail(bb, stmt, "IRStmt: is not flat");
3771 if (!isIRAtom(bb->next))
3772 sanityCheckFail(bb, NULL, "bb->next is not an atom");
3781 for (i = 0; i < bb->stmts_used; i++) {
3784 stmt = bb->stmts[i];
3786 useBeforeDef_Stmt(bb,stmt,def_counts);
3792 sanityCheckFail(bb, stmt,
3796 sanityCheckFail(bb, stmt,
3805 sanityCheckFail(bb, stmt,
3809 sanityCheckFail(bb, stmt,
3817 sanityCheckFail(bb, stmt,
3821 sanityCheckFail(bb, stmt,
3825 sanityCheckFail(bb, stmt,
3829 sanityCheckFail(bb, stmt,
3834 sanityCheckFail(bb, stmt,
3838 sanityCheckFail(bb, stmt,
3848 for (i = 0; i < bb->stmts_used; i++)
3849 if (bb->stmts[i])
3850 tcStmt( bb, bb->stmts[i], guest_word_size );
3851 if (typeOfIRExpr(bb->tyenv,bb->next) != guest_word_size)
3852 sanityCheckFail(bb, NULL, "bb->next field has wrong type");
3854 if (bb->offsIP < 16)
3855 sanityCheckFail(bb, NULL, "bb->offsIP: too low");