From 28c04eaca54fba5012a8fa6804082a67b0261fd8 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Fri, 24 Nov 2006 23:32:55 +0000 Subject: [PATCH] New function dopyIRBBExceptStmts which makes it a bit easier to write tools. git-svn-id: svn://svn.valgrind.org/vex/trunk@1684 --- VEX/priv/ir/irdefs.c | 10 ++++++++-- VEX/pub/libvex_ir.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/VEX/priv/ir/irdefs.c b/VEX/priv/ir/irdefs.c index 5598801e32..28d9d2c040 100644 --- a/VEX/priv/ir/irdefs.c +++ b/VEX/priv/ir/irdefs.c @@ -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; diff --git a/VEX/pub/libvex_ir.h b/VEX/pub/libvex_ir.h index 0f298b6f0b..14c4f5c26f 100644 --- a/VEX/pub/libvex_ir.h +++ b/VEX/pub/libvex_ir.h @@ -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 */ -- 2.47.2