]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
New function dopyIRBBExceptStmts which makes it a bit easier to write
authorJulian Seward <jseward@acm.org>
Fri, 24 Nov 2006 23:32:55 +0000 (23:32 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 24 Nov 2006 23:32:55 +0000 (23:32 +0000)
tools.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1684

VEX/priv/ir/irdefs.c
VEX/pub/libvex_ir.h

index 5598801e328d93859a0c54c5af8abecc4fbdf124..28d9d2c040f38acaadeb9dc496aa26b74446316f 100644 (file)
@@ -1382,13 +1382,19 @@ IRBB* dopyIRBB ( IRBB* bb )
 {
    Int      i;
    IRStmt** sts2;
-   IRBB* bb2 = emptyIRBB();
-   bb2->tyenv = dopyIRTypeEnv(bb->tyenv);
+   IRBB* bb2 = dopyIRBBExceptStmts(bb);
    bb2->stmts_used = bb2->stmts_size = bb->stmts_used;
    sts2 = LibVEX_Alloc(bb2->stmts_used * sizeof(IRStmt*));
    for (i = 0; i < bb2->stmts_used; i++)
       sts2[i] = dopyIRStmt(bb->stmts[i]);
    bb2->stmts    = sts2;
+   return bb2;
+}
+
+IRBB* dopyIRBBExceptStmts ( IRBB* bb )
+{
+   IRBB* bb2     = emptyIRBB();
+   bb2->tyenv    = dopyIRTypeEnv(bb->tyenv);
    bb2->next     = dopyIRExpr(bb->next);
    bb2->jumpkind = bb->jumpkind;
    return bb2;
index 0f298b6f0b698eac021a5cd6afe55a37af060784..14c4f5c26fccaf3d619503969dc3eaf9bb15b54d 100644 (file)
@@ -1541,7 +1541,8 @@ extern IRBB* emptyIRBB ( void );
 /* Deep-copy an IRBB */
 extern IRBB* dopyIRBB ( IRBB* );
 
-/* Deep-copy an IRBB, except for the statements list. */
+/* Deep-copy an IRBB, except for the statements list, which set to be
+   a new, empty, list of statements. */
 extern IRBB* dopyIRBBExceptStmts ( IRBB* );
 
 /* Pretty-print an IRBB */