From: Julian Seward Date: Tue, 28 Aug 2007 06:06:27 +0000 (+0000) Subject: Merge, from CGTUNE branch, r1774: X-Git-Tag: svn/VALGRIND_3_3_1^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d9ffbc62faeee23b7efd47e71bd860e46ea5ded;p=thirdparty%2Fvalgrind.git Merge, from CGTUNE branch, r1774: Vex-side changes to allow tools to provide a final_tidy function which they can use to mess with the final post-tree-built IR before it is handed off to instruction selection. git-svn-id: svn://svn.valgrind.org/vex/trunk@1782 --- diff --git a/VEX/priv/main/vex_main.c b/VEX/priv/main/vex_main.c index 9fabf70107..9e3ba20800 100644 --- a/VEX/priv/main/vex_main.c +++ b/VEX/priv/main/vex_main.c @@ -544,6 +544,10 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta ) also throws away any dead bindings. */ ado_treebuild_BB( irsb ); + if (vta->finaltidy) { + irsb = vta->finaltidy(irsb); + } + vexAllocSanityCheck(); if (vex_traceflags & VEX_TRACE_TREES) { diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 0d5a3377c0..bb1087157a 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -452,6 +452,8 @@ typedef VexGuestExtents*, IRType gWordTy, IRType hWordTy ); + IRSB* (*finaltidy) ( IRSB* ); + /* IN: should this translation be self-checking? default: False */ Bool do_self_check;