Allow iropt to pass helper function calls back to the front end
in the hope of getting specialised versions thereof.

Use this mechanism to greatly improve handling of condition
codes.  Various ensuing small changes.



git-svn-id: svn://svn.valgrind.org/vex/trunk@194 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index fb88ae4..1becac3 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -99,6 +99,7 @@
                                          Bool(*)(Addr64), Bool );
    Int          (*emit)        ( UChar*, Int, HInstr* );
    Addr64       (*findHelper)  ( Char* );
+   IRExpr*      (*specHelper)  ( Char*, IRExpr** );
 
    Bool         host_is_bigendian = False;
    IRBB*        irbb;
@@ -120,6 +121,7 @@
    bbToIR                 = NULL;
    emit                   = NULL;
    findHelper             = NULL;
+   specHelper             = NULL;
 
    saved_verbosity = vex_verbosity;
    if (bb_verbosity > 0)
@@ -153,6 +155,7 @@
       case InsnSetX86:
          bbToIR     = bbToIR_X86Instr;
          findHelper = x86guest_findhelper;
+         specHelper = x86guest_spechelper;
          break;
       default:
          vpanic("LibVEX_Translate: unsupported guest insn set");
@@ -173,7 +176,7 @@
    sanityCheckIRBB(irbb, Ity_I32);
 
    /* Clean it up, hopefully a lot. */
-   irbb = do_iropt_BB ( irbb );
+   irbb = do_iropt_BB ( irbb, specHelper );
    sanityCheckIRBB(irbb, Ity_I32);
 
    if (vex_verbosity > 0) {