Use the newly-added dopyIRBBExceptStmts() in tools.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6372 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index e1ccc41..f61c801 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -724,12 +724,8 @@
       VG_(tool_panic)("host/guest word size mismatch");
    }
 
-   /* Set up BB, including copying of the where-next stuff. */
-   cgs.bbOut           = emptyIRBB();
-   cgs.bbOut->tyenv    = dopyIRTypeEnv(tyenv);
-   tl_assert( isIRAtom(bbIn->next) );
-   cgs.bbOut->next     = dopyIRExpr(bbIn->next);
-   cgs.bbOut->jumpkind = bbIn->jumpkind;
+   // Set up new BB
+   cgs.bbOut = dopyIRBBExceptStmts(bbIn);
 
    // Copy verbatim any IR preamble preceding the first IMark
    i = 0;
diff --git a/callgrind/main.c b/callgrind/main.c
index 4b54ef5..4bae4e0 100644
--- a/callgrind/main.c
+++ b/callgrind/main.c
@@ -530,10 +530,7 @@
    CLG_DEBUG(3, "+ instrument(BB %p)\n", (Addr)closure->readdr);
 
    /* Set up BB for instrumented IR */
-   bbOut           = emptyIRBB();
-   bbOut->tyenv    = dopyIRTypeEnv(bbIn->tyenv);
-   bbOut->next     = dopyIRExpr(bbIn->next);
-   bbOut->jumpkind = bbIn->jumpkind;
+   bbOut = dopyIRBBExceptStmts(bbIn);
 
    // Copy verbatim any IR preamble preceding the first IMark
    i = 0;
diff --git a/lackey/lk_main.c b/lackey/lk_main.c
index c85638b..4a8745d 100644
--- a/lackey/lk_main.c
+++ b/lackey/lk_main.c
@@ -560,10 +560,7 @@
    }
 
    /* Set up BB */
-   bbOut           = emptyIRBB();
-   bbOut->tyenv    = dopyIRTypeEnv(bbIn->tyenv);
-   bbOut->next     = dopyIRExpr(bbIn->next);
-   bbOut->jumpkind = bbIn->jumpkind;
+   bbOut = dopyIRBBExceptStmts(bbIn);
 
    // Copy verbatim any IR preamble preceding the first IMark
    i = 0;
diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c
index 5e9cc84..ac38e5e 100644
--- a/memcheck/mc_translate.c
+++ b/memcheck/mc_translate.c
@@ -3257,10 +3257,7 @@
    tl_assert(sizeof(Int)   == 4);
 
    /* Set up BB */
-   bb           = emptyIRBB();
-   bb->tyenv    = dopyIRTypeEnv(bb_in->tyenv);
-   bb->next     = dopyIRExpr(bb_in->next);
-   bb->jumpkind = bb_in->jumpkind;
+   bb = dopyIRBBExceptStmts(bb_in);
 
    /* Set up the running environment.  Only .bb is modified as we go
       along. */