From 7d9ffbc62faeee23b7efd47e71bd860e46ea5ded Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Tue, 28 Aug 2007 06:06:27 +0000 Subject: [PATCH] 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 --- VEX/priv/main/vex_main.c | 4 ++++ VEX/pub/libvex.h | 2 ++ 2 files changed, 6 insertions(+) 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; -- 2.47.2