/*---------------------------------------------------------------*/
#include "libvex_basictypes.h"
+#include "libvex_ir.h"
#include "libvex.h"
#include "main/vex_util.h"
+#include "ir/iropt.h"
/*---------------------------------------------------------------*/
h->used++;
}
+
+/*---------------------------------------------------------------*/
+/*--- iropt main ---*/
+/*---------------------------------------------------------------*/
+
+/* Rules of the game:
+
+ - IRExpr/IRStmt trees should be treated as immutable, as they
+ may get shared. So never change a field of such a tree node;
+ instead construct and return a new one if needed.
+*/
+
+/* exported from this file */
+IRBB* do_iropt_BB ( IRBB* bb0 )
+{
+ return bb0;
+}
+
+
/*---------------------------------------------------------------*/
/*--- end ir/iropt.c ---*/
/*---------------------------------------------------------------*/
--- /dev/null
+
+/*---------------------------------------------------------------*/
+/*--- ---*/
+/*--- This file (ir/iropt.h) is ---*/
+/*--- Copyright (c) 2004 OpenWorks LLP. All rights reserved. ---*/
+/*--- ---*/
+/*---------------------------------------------------------------*/
+
+#include "libvex_basictypes.h"
+#include "libvex_ir.h"
+#include "libvex.h"
+
+
+extern IRBB* do_iropt_BB ( IRBB* );
+
+/*---------------------------------------------------------------*/
+/*--- end ir/iropt.h ---*/
+/*---------------------------------------------------------------*/
#include "host-generic/h_generic_regs.h"
#include "host-x86/hdefs.h"
#include "guest-x86/gdefs.h"
+#include "ir/iropt.h"
/* This file contains the top level interface to the library. */
}
sanityCheckIRBB(irbb, Ity_I32);
+ /* Clean it up, hopefully a lot. */
+ irbb = do_iropt_BB ( irbb );
+
+ if (vex_verbosity > 0) {
+ vex_printf("\n-------- After IR optimisation --------\n");
+ ppIRBB ( irbb );
+ vex_printf("\n");
+ }
+
/* Get the thing instrumented. */
if (instrument)
irbb = (*instrument)(irbb);