Rename some types and data fields in a more logical way.  No change of
functionality.



git-svn-id: svn://svn.valgrind.org/vex/trunk@474 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/guest-x86/gdefs.h b/priv/guest-x86/gdefs.h
index f4d7149..896d6e4 100644
--- a/priv/guest-x86/gdefs.h
+++ b/priv/guest-x86/gdefs.h
@@ -38,7 +38,7 @@
 Bool guest_x86_state_requires_precise_mem_exns ( Int, Int );
 
 extern
-VexGuestLayoutInfo x86guest_layout;
+VexGuestLayout x86guest_layout;
 
 
 /*---------------------------------------------------------*/
diff --git a/priv/guest-x86/ghelpers.c b/priv/guest-x86/ghelpers.c
index 50dea82..d2b6fd5 100644
--- a/priv/guest-x86/ghelpers.c
+++ b/priv/guest-x86/ghelpers.c
@@ -1444,25 +1444,58 @@
    Int eip_max = eip_min + 4 - 1;
 
    if (maxoff < esp_min || minoff > esp_max) {
-     /* no overlap with esp */
+      /* no overlap with esp */
    } else {
-     return True;
+      return True;
    }
 
    if (maxoff < eip_min || minoff > eip_max) {
-     /* no overlap with eip */
+      /* no overlap with eip */
    } else {
-     return True;
+      return True;
    }
 
    return False;
 }
 
 
-VexGuestLayoutInfo 
+#define ALWAYSDEFD(field)                           \
+    { offsetof(VexGuestX86State, field),            \
+      (sizeof ((VexGuestX86State*)0)->field) }
+
+VexGuestLayout
    x86guest_layout 
-      = { .offset_SP = offsetof(VexGuestX86State, guest_ESP),
-          .sizeof_SP   = 4 };
+      = { 
+          /* Total size of the guest state, in bytes. */
+          .total_sizeB = sizeof(VexGuestX86State),
+
+          /* Describe the stack pointer. */
+          .offset_SP = offsetof(VexGuestX86State,guest_ESP),
+          .sizeof_SP = 4,
+
+          /* Describe any indexable sections */
+          .n_descrs = 2,
+          .descrs[0] = { offsetof(VexGuestX86State,guest_FPREG), Ity_F64, 8 },
+          .descrs[1] = { offsetof(VexGuestX86State,guest_FPTAG), Ity_I8, 8 },
+
+          /* Describe any sections to be regarded by Memcheck as
+             'always-defined'. */
+          .n_alwaysDefd = 14,
+          .alwaysDefd[0]  = ALWAYSDEFD(guest_CC_OP),
+          .alwaysDefd[1]  = ALWAYSDEFD(guest_DFLAG),
+          .alwaysDefd[2]  = ALWAYSDEFD(guest_IDFLAG),
+          .alwaysDefd[3]  = ALWAYSDEFD(guest_EIP),
+          .alwaysDefd[4]  = ALWAYSDEFD(guest_FTOP),
+          .alwaysDefd[5]  = ALWAYSDEFD(guest_FPTAG),
+          .alwaysDefd[6]  = ALWAYSDEFD(guest_FPUCW),
+          .alwaysDefd[7]  = ALWAYSDEFD(guest_FC3210),
+          .alwaysDefd[8]  = ALWAYSDEFD(guest_CS),
+          .alwaysDefd[9]  = ALWAYSDEFD(guest_DS),
+          .alwaysDefd[10] = ALWAYSDEFD(guest_ES),
+          .alwaysDefd[11] = ALWAYSDEFD(guest_FS),
+          .alwaysDefd[12] = ALWAYSDEFD(guest_GS),
+          .alwaysDefd[13] = ALWAYSDEFD(guest_SS)
+        };
 
 
 /*---------------------------------------------------------------*/
diff --git a/priv/host-x86/isel.c b/priv/host-x86/isel.c
index 64fec2c..5561dba 100644
--- a/priv/host-x86/isel.c
+++ b/priv/host-x86/isel.c
@@ -948,7 +948,7 @@
       X86AMode* am 
          = genGuestArrayOffset(
               env, e->Iex.GetI.descr, 
-                   e->Iex.GetI.off, e->Iex.GetI.bias );
+                   e->Iex.GetI.ix, e->Iex.GetI.bias );
       HReg dst = newVRegI(env);
       if (ty == Ity_I8) {
          addInstr(env, X86Instr_LoadEX( 1, False, am, dst ));
@@ -1712,7 +1712,7 @@
       vassert(e->Iex.GetI.ty == Ity_I64);
       HReg tLo = newVRegI(env);
       HReg tHi = newVRegI(env);
-      HReg idx = iselIntExpr_R(env, e->Iex.GetI.offset);
+      HReg idx = iselIntExpr_R(env, e->Iex.GetI.ixset);
 
       /* This (x86) is a little-endian target.  The front end will
 	 have laid out the baseblock in accordance with the back-end's
@@ -1875,7 +1875,7 @@
       X86AMode* am 
          = genGuestArrayOffset(
               env, e->Iex.GetI.descr, 
-                   e->Iex.GetI.off, e->Iex.GetI.bias );
+                   e->Iex.GetI.ix, e->Iex.GetI.bias );
       HReg res = newVRegF(env);
       addInstr(env, X86Instr_FpLdSt( True/*load*/, 8, res, am ));
       return res;
@@ -2136,7 +2136,7 @@
       X86AMode* am 
          = genGuestArrayOffset(
               env, stmt->Ist.PutI.descr, 
-                   stmt->Ist.PutI.off, stmt->Ist.PutI.bias );
+                   stmt->Ist.PutI.ix, stmt->Ist.PutI.bias );
 
       IRType ty = typeOfIRExpr(env->type_env, stmt->Ist.PutI.data);
       if (ty == Ity_F64) {
diff --git a/priv/ir/irdefs.c b/priv/ir/irdefs.c
index 7bebe08..38e84db 100644
--- a/priv/ir/irdefs.c
+++ b/priv/ir/irdefs.c
@@ -214,7 +214,7 @@
       vex_printf( "GETI" );
       ppIRArray(e->Iex.GetI.descr);
       vex_printf("[");
-      ppIRExpr(e->Iex.GetI.off);
+      ppIRExpr(e->Iex.GetI.ix);
       vex_printf(",%d]", e->Iex.GetI.bias);
       break;
     case Iex_Tmp:
@@ -325,7 +325,7 @@
          vex_printf( "PUTI" );
          ppIRArray(s->Ist.PutI.descr);
          vex_printf("[");
-         ppIRExpr(s->Ist.PutI.off);
+         ppIRExpr(s->Ist.PutI.ix);
          vex_printf(",%d] = ", s->Ist.PutI.bias);
          ppIRExpr(s->Ist.PutI.data);
          break;
@@ -508,11 +508,11 @@
    e->Iex.Get.ty     = ty;
    return e;
 }
-IRExpr* IRExpr_GetI ( IRArray* descr, IRExpr* off, Int bias ) {
+IRExpr* IRExpr_GetI ( IRArray* descr, IRExpr* ix, Int bias ) {
    IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
    e->tag            = Iex_GetI;
    e->Iex.GetI.descr = descr;
-   e->Iex.GetI.off   = off;
+   e->Iex.GetI.ix    = ix;
    e->Iex.GetI.bias  = bias;
    return e;
 }
@@ -634,12 +634,12 @@
    s->Ist.Put.data   = data;
    return s;
 }
-IRStmt* IRStmt_PutI ( IRArray* descr, IRExpr* off,
+IRStmt* IRStmt_PutI ( IRArray* descr, IRExpr* ix,
                       Int bias, IRExpr* data ) {
    IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
    s->tag            = Ist_PutI;
    s->Ist.PutI.descr = descr;
-   s->Ist.PutI.off   = off;
+   s->Ist.PutI.ix    = ix;
    s->Ist.PutI.bias  = bias;
    s->Ist.PutI.data  = data;
    return s;
@@ -768,7 +768,7 @@
          return IRExpr_Get(e->Iex.Get.offset, e->Iex.Get.ty);
       case Iex_GetI: 
          return IRExpr_GetI(dopyIRArray(e->Iex.GetI.descr), 
-                            dopyIRExpr(e->Iex.GetI.off),
+                            dopyIRExpr(e->Iex.GetI.ix),
                             e->Iex.GetI.bias);
       case Iex_Tmp: 
          return IRExpr_Tmp(e->Iex.Tmp.tmp);
@@ -823,7 +823,7 @@
                            dopyIRExpr(s->Ist.Put.data));
       case Ist_PutI: 
          return IRStmt_PutI(dopyIRArray(s->Ist.PutI.descr),
-                            dopyIRExpr(s->Ist.PutI.off),
+                            dopyIRExpr(s->Ist.PutI.ix),
                             s->Ist.PutI.bias, 
                             dopyIRExpr(s->Ist.PutI.data));
       case Ist_Tmp:
@@ -1219,7 +1219,7 @@
       case Iex_Get: 
          break;
       case Iex_GetI:
-         useBeforeDef_Expr(bb,stmt,expr->Iex.GetI.off,def_counts);
+         useBeforeDef_Expr(bb,stmt,expr->Iex.GetI.ix,def_counts);
          break;
       case Iex_Tmp:
          useBeforeDef_Temp(bb,stmt,expr->Iex.Tmp.tmp,def_counts);
@@ -1260,7 +1260,7 @@
          useBeforeDef_Expr(bb,stmt,stmt->Ist.Put.data,def_counts);
          break;
       case Ist_PutI:
-         useBeforeDef_Expr(bb,stmt,stmt->Ist.PutI.off,def_counts);
+         useBeforeDef_Expr(bb,stmt,stmt->Ist.PutI.ix,def_counts);
          useBeforeDef_Expr(bb,stmt,stmt->Ist.PutI.data,def_counts);
          break;
       case Ist_Tmp:
@@ -1296,9 +1296,9 @@
       case Iex_Tmp:
          break;
       case Iex_GetI:
-         tcExpr(bb,stmt, expr->Iex.GetI.off, gWordTy );
-         if (typeOfIRExpr(tyenv,expr->Iex.GetI.off) != Ity_I32)
-            sanityCheckFail(bb,stmt,"IRExpr.GetI.off: not :: Ity_I32");
+         tcExpr(bb,stmt, expr->Iex.GetI.ix, gWordTy );
+         if (typeOfIRExpr(tyenv,expr->Iex.GetI.ix) != Ity_I32)
+            sanityCheckFail(bb,stmt,"IRExpr.GetI.ix: not :: Ity_I32");
          if (!saneIRArray(expr->Iex.GetI.descr))
             sanityCheckFail(bb,stmt,"IRExpr.GetI.descr: invalid descr");
          break;
@@ -1396,14 +1396,14 @@
          break;
       case Ist_PutI:
          tcExpr( bb, stmt, stmt->Ist.PutI.data, gWordTy );
-         tcExpr( bb, stmt, stmt->Ist.PutI.off, gWordTy );
+         tcExpr( bb, stmt, stmt->Ist.PutI.ix, gWordTy );
          if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) == Ity_Bit)
             sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_Bit");
          if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) 
              != stmt->Ist.PutI.descr->elemTy)
             sanityCheckFail(bb,stmt,"IRStmt.PutI.data: data ty != elem ty");
-         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.off) != Ity_I32)
-            sanityCheckFail(bb,stmt,"IRStmt.PutI.off: not :: Ity_I32");
+         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.ix) != Ity_I32)
+            sanityCheckFail(bb,stmt,"IRStmt.PutI.ix: not :: Ity_I32");
          if (!saneIRArray(stmt->Ist.PutI.descr))
             sanityCheckFail(bb,stmt,"IRStmt.PutI.descr: invalid descr");
          break;
diff --git a/priv/ir/iropt.c b/priv/ir/iropt.c
index 48abdfa..40c019d 100644
--- a/priv/ir/iropt.c
+++ b/priv/ir/iropt.c
@@ -182,7 +182,7 @@
          t1 = newIRTemp(bb->tyenv, ty);
          addStmtToIRBB(bb, IRStmt_Tmp(t1,
             IRExpr_GetI(ex->Iex.GetI.descr,
-                        flatten_Expr(bb, ex->Iex.GetI.off),
+                        flatten_Expr(bb, ex->Iex.GetI.ix),
                         ex->Iex.GetI.bias)));
          return IRExpr_Tmp(t1);
 
@@ -278,7 +278,7 @@
          }
          break;
       case Ist_PutI:
-         e1 = flatten_Expr(bb, st->Ist.PutI.off);
+         e1 = flatten_Expr(bb, st->Ist.PutI.ix);
          e2 = flatten_Expr(bb, st->Ist.PutI.data);
          addStmtToIRBB(bb, IRStmt_PutI(st->Ist.PutI.descr,
                                        e1,
@@ -618,10 +618,10 @@
          return ex;
 
       case Iex_GetI:
-         vassert(isAtom(ex->Iex.GetI.off));
+         vassert(isAtom(ex->Iex.GetI.ix));
          return IRExpr_GetI(
             ex->Iex.GetI.descr,
-            subst_Expr(env, ex->Iex.GetI.off),
+            subst_Expr(env, ex->Iex.GetI.ix),
             ex->Iex.GetI.bias
          );
 
@@ -701,11 +701,11 @@
                 );
 
       case Ist_PutI:
-         vassert(isAtom(st->Ist.PutI.off));
+         vassert(isAtom(st->Ist.PutI.ix));
          vassert(isAtom(st->Ist.PutI.data));
          return IRStmt_PutI(
                    st->Ist.PutI.descr,
-                   fold_Expr(subst_Expr(env, st->Ist.PutI.off)),
+                   fold_Expr(subst_Expr(env, st->Ist.PutI.ix)),
                    st->Ist.PutI.bias,
                    fold_Expr(subst_Expr(env, st->Ist.PutI.data))
                 );
@@ -866,7 +866,7 @@
    Int i;
    switch (e->tag) {
       case Iex_GetI:
-         addUses_Expr(set, e->Iex.GetI.off);
+         addUses_Expr(set, e->Iex.GetI.ix);
          return;
       case Iex_Mux0X:
          addUses_Expr(set, e->Iex.Mux0X.cond);
@@ -906,7 +906,7 @@
    IRDirty* d;
    switch (st->tag) {
       case Ist_PutI:
-         addUses_Expr(set, st->Ist.PutI.off);
+         addUses_Expr(set, st->Ist.PutI.ix);
          addUses_Expr(set, st->Ist.PutI.data);
          return;
       case Ist_Tmp:
@@ -1216,7 +1216,7 @@
          break;
 
       case Ist_PutI:
-         vassert(isAtom(st->Ist.PutI.off));
+         vassert(isAtom(st->Ist.PutI.ix));
          vassert(isAtom(st->Ist.PutI.data));
          break;
 
@@ -1305,7 +1305,7 @@
          case Ist_PutI:
             isPut = True;
             key = mk_key_GetIPutI( st->Ist.PutI.descr );
-            vassert(isAtom(st->Ist.PutI.off));
+            vassert(isAtom(st->Ist.PutI.ix));
             vassert(isAtom(st->Ist.PutI.data));
             break;
          default: 
@@ -1455,7 +1455,7 @@
          return;
 
       case Iex_GetI:
-         occCount_Expr(env, e->Iex.GetI.off);
+         occCount_Expr(env, e->Iex.GetI.ix);
          return;
 
       case Iex_Const:
@@ -1485,7 +1485,7 @@
          occCount_Expr(env, st->Ist.Put.data);
          return;
       case Ist_PutI:
-         occCount_Expr(env, st->Ist.PutI.off);
+         occCount_Expr(env, st->Ist.PutI.ix);
          occCount_Expr(env, st->Ist.PutI.data);
          return;
       case Ist_STle: 
@@ -1580,7 +1580,7 @@
       case Iex_GetI:
          return IRExpr_GetI(
                    e->Iex.GetI.descr,
-                   tbSubst_Expr(env, e->Iex.GetI.off),
+                   tbSubst_Expr(env, e->Iex.GetI.ix),
                    e->Iex.GetI.bias
                 );
       case Iex_Const:
@@ -1618,7 +1618,7 @@
       case Ist_PutI:
          return IRStmt_PutI(
                    st->Ist.PutI.descr,
-                   tbSubst_Expr(env, st->Ist.PutI.off),
+                   tbSubst_Expr(env, st->Ist.PutI.ix),
                    st->Ist.PutI.bias,
                    tbSubst_Expr(env, st->Ist.PutI.data)
                 );
@@ -1677,7 +1677,7 @@
          return;
       case Iex_GetI:
          *doesGet = True;
-         setHints_Expr(doesLoad, doesGet, e->Iex.GetI.off);
+         setHints_Expr(doesLoad, doesGet, e->Iex.GetI.ix);
          return;
       case Iex_Tmp:
       case Iex_Const:
@@ -2184,7 +2184,7 @@
 }
 
 
-/* Figure out if tmp can be expressed as tmp3 +32 const, for some
+/* Figure out if tmp can be expressed as tmp2 +32 const, for some
    other tmp2.  Scan backwards from the specified start point -- an
    optimisation. */
 
@@ -2281,8 +2281,8 @@
 
       if (st->tag == Ist_Tmp
           && st->Ist.Tmp.data->tag == Iex_GetI
-          && st->Ist.Tmp.data->Iex.GetI.off->tag == Iex_Tmp
-          && collapseChain(bb, i-1, st->Ist.Tmp.data->Iex.GetI.off
+          && st->Ist.Tmp.data->Iex.GetI.ix->tag == Iex_Tmp
+          && collapseChain(bb, i-1, st->Ist.Tmp.data->Iex.GetI.ix
                                       ->Iex.Tmp.tmp, &var2, &con2)) {
          if (DEBUG_IROPT) {
             vex_printf("replacing3 ");
@@ -2306,8 +2306,8 @@
       /* Perhaps st is PutI[t, con] ? */
 
       if (st->tag == Ist_PutI
-          && st->Ist.PutI.off->tag == Iex_Tmp
-          && collapseChain(bb, i-1, st->Ist.PutI.off->Iex.Tmp.tmp, 
+          && st->Ist.PutI.ix->tag == Iex_Tmp
+          && collapseChain(bb, i-1, st->Ist.PutI.ix->Iex.Tmp.tmp, 
                                &var2, &con2)) {
          if (DEBUG_IROPT) {
             vex_printf("replacing2 ");
@@ -2509,7 +2509,7 @@
          relation = getAliasingRelation_II(
                        descrG, ixG, biasG,
                        st->Ist.PutI.descr,
-                       st->Ist.PutI.off,
+                       st->Ist.PutI.ix,
                        st->Ist.PutI.bias
                     );
 
@@ -2558,8 +2558,8 @@
       return False;
 
    return getAliasingRelation_II( 
-             pi->Ist.PutI.descr, pi->Ist.PutI.off, pi->Ist.PutI.bias, 
-             s2->Ist.PutI.descr, s2->Ist.PutI.off, s2->Ist.PutI.bias
+             pi->Ist.PutI.descr, pi->Ist.PutI.ix, pi->Ist.PutI.bias, 
+             s2->Ist.PutI.descr, s2->Ist.PutI.ix, s2->Ist.PutI.bias
           )
           == ExactAlias;
 }
@@ -2592,19 +2592,19 @@
          vassert(isAtom(s2->Ist.Put.data));
          relation 
             = getAliasingRelation_IC(
-                 pi->Ist.PutI.descr, pi->Ist.PutI.off,
+                 pi->Ist.PutI.descr, pi->Ist.PutI.ix,
                  s2->Ist.Put.offset, 
                  typeOfIRExpr(tyenv,s2->Ist.Put.data)
               );
          goto have_relation;
 
       case Ist_PutI:
-         vassert(isAtom(s2->Ist.PutI.off));
+         vassert(isAtom(s2->Ist.PutI.ix));
          vassert(isAtom(s2->Ist.PutI.data));
          relation
             = getAliasingRelation_II(
-                 pi->Ist.PutI.descr, pi->Ist.PutI.off, pi->Ist.PutI.bias, 
-                 s2->Ist.PutI.descr, s2->Ist.PutI.off, s2->Ist.PutI.bias
+                 pi->Ist.PutI.descr, pi->Ist.PutI.ix, pi->Ist.PutI.bias, 
+                 s2->Ist.PutI.descr, s2->Ist.PutI.ix, s2->Ist.PutI.bias
               );
          goto have_relation;
 
@@ -2612,10 +2612,10 @@
          if (s2->Ist.Tmp.data->tag == Iex_GetI) {
             relation
                = getAliasingRelation_II(
-                    pi->Ist.PutI.descr, pi->Ist.PutI.off, 
+                    pi->Ist.PutI.descr, pi->Ist.PutI.ix, 
                                         pi->Ist.PutI.bias, 
                     s2->Ist.Tmp.data->Iex.GetI.descr,
-                    s2->Ist.Tmp.data->Iex.GetI.off,
+                    s2->Ist.Tmp.data->Iex.GetI.ix,
                     s2->Ist.Tmp.data->Iex.GetI.bias
                  );
             goto have_relation;
@@ -2623,7 +2623,7 @@
          if (s2->Ist.Tmp.data->tag == Iex_Get) {
             relation
                = getAliasingRelation_IC(
-                    pi->Ist.PutI.descr, pi->Ist.PutI.off,
+                    pi->Ist.PutI.descr, pi->Ist.PutI.ix,
                     s2->Ist.Tmp.data->Iex.Get.offset,
                     s2->Ist.Tmp.data->Iex.Get.ty
                  );
@@ -2667,9 +2667,9 @@
 
       if (st->tag == Ist_Tmp
           && st->Ist.Tmp.data->tag == Iex_GetI
-          && st->Ist.Tmp.data->Iex.GetI.off->tag == Iex_Tmp) {
+          && st->Ist.Tmp.data->Iex.GetI.ix->tag == Iex_Tmp) {
          IRArray* descr = st->Ist.Tmp.data->Iex.GetI.descr;
-         IRExpr*  ix    = st->Ist.Tmp.data->Iex.GetI.off;
+         IRExpr*  ix    = st->Ist.Tmp.data->Iex.GetI.ix;
          Int      bias  = st->Ist.Tmp.data->Iex.GetI.bias;
          IRExpr*  replacement = findPutI(bb, i-1, descr, ix, bias);
          if (replacement 
@@ -2769,7 +2769,7 @@
       case Iex_Const:
          break;
       case Iex_GetI:
-         deltaIRExpr(e->Iex.GetI.off, delta);
+         deltaIRExpr(e->Iex.GetI.ix, delta);
          break;
       case Iex_Binop:
          deltaIRExpr(e->Iex.Binop.arg1, delta);
@@ -2808,7 +2808,7 @@
          deltaIRExpr(st->Ist.Put.data, delta);
          break;
       case Ist_PutI:
-         deltaIRExpr(st->Ist.PutI.off, delta);
+         deltaIRExpr(st->Ist.PutI.ix, delta);
          deltaIRExpr(st->Ist.PutI.data, delta);
          break;
       case Ist_Tmp: 
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index d61c561..f3b76d5 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -126,8 +126,8 @@
    /* OUT: how much of the output area is used. */
    Int* host_bytes_used,
    /* IN: optionally, two instrumentation functions. */
-   IRBB* (*instrument1) ( IRBB*, VexGuestLayoutInfo* ),
-   IRBB* (*instrument2) ( IRBB*, VexGuestLayoutInfo* ),
+   IRBB* (*instrument1) ( IRBB*, VexGuestLayout* ),
+   IRBB* (*instrument2) ( IRBB*, VexGuestLayout* ),
    /* IN: optionally, an access check function for guest code. */
    Bool (*byte_accessible) ( Addr64 ),
    /* IN: debug: trace vex activity at various points */
@@ -153,14 +153,14 @@
    IRExpr*      (*specHelper)  ( Char*, IRExpr** );
    Bool         (*preciseMemExnsFn) ( Int, Int );
 
-   VexGuestLayoutInfo* guest_layout;
-   Bool                host_is_bigendian = False;
-   IRBB*               irbb;
-   HInstrArray*        vcode;
-   HInstrArray*        rcode;
-   Int                 i, j, k, out_used, guest_sizeB;
-   UChar               insn_bytes[32];
-   IRType              guest_word_size;
+   VexGuestLayout* guest_layout;
+   Bool            host_is_bigendian = False;
+   IRBB*           irbb;
+   HInstrArray*    vcode;
+   HInstrArray*    rcode;
+   Int             i, j, k, out_used, guest_sizeB;
+   UChar           insn_bytes[32];
+   IRType          guest_word_size;
 
    guest_layout           = NULL;
    available_real_regs    = NULL;
diff --git a/pub/libvex.h b/pub/libvex.h
index e69b8cc..e8cbc8f 100644
--- a/pub/libvex.h
+++ b/pub/libvex.h
@@ -92,13 +92,33 @@
 /* Describe the guest state enough that the instrumentation
    functions can work. */
 
+/* The max number of indexable guest state sections we can describe.
+   2 is enough for x86. */
+#define VEXGLO_N_DESCRS 2
+
+/* The max number of guest state chunks which we can describe as
+   always defined (for the benefit of Memcheck). */
+#define VEXGLO_N_ALWAYSDEFD  14
+
 typedef
    struct {
+      /* Total size of the guest state, in bytes. */
+      Int total_sizeB;
       /* Whereabouts is the stack pointer? */
       Int offset_SP;
       Int sizeof_SP; /* 4 or 8 */
+      /* Describe the indexed sections */
+      Int     n_descrs; /* must be 0 .. VEXG_N_DESCRS */
+      IRArray descrs[VEXGLO_N_DESCRS];
+      /* Describe parts of the guest state regarded as 'always
+         defined'. */
+      Int n_alwaysDefd;
+      struct {
+         Int offset;
+         Int size;
+      } alwaysDefd[VEXGLO_N_ALWAYSDEFD];
    }
-   VexGuestLayoutInfo;
+   VexGuestLayout;
 
 
 /* Translate a basic block. */
@@ -127,8 +147,8 @@
    /* OUT: how much of the output area is used. */
    Int* host_bytes_used,
    /* IN: optionally, two instrumentation functions. */
-   IRBB* (*instrument1) ( IRBB*, VexGuestLayoutInfo* ),
-   IRBB* (*instrument2) ( IRBB*, VexGuestLayoutInfo* ),
+   IRBB* (*instrument1) ( IRBB*, VexGuestLayout* ),
+   IRBB* (*instrument2) ( IRBB*, VexGuestLayout* ),
    /* IN: optionally, an access check function for guest code. */
    Bool (*byte_accessible) ( Addr64 ),
    /* IN: debug: trace vex activity at various points */
diff --git a/pub/libvex_ir.h b/pub/libvex_ir.h
index a62a312..84429ff 100644
--- a/pub/libvex_ir.h
+++ b/pub/libvex_ir.h
@@ -269,11 +269,9 @@
    }
    IROp;
 
-
 extern void ppIROp ( IROp );
 
 
-
 /* Encoding of IEEE754-specified rounding modes in Float -> Int
    conversions.  This is the same as the encoding used by Intel IA32
    to indicate x87 rounding mode. */
@@ -379,7 +377,7 @@
          } Get;
          struct {
             IRArray* descr;
-            struct _IRExpr* off;
+            struct _IRExpr* ix;
             Int bias;
          } GetI;
          struct {
@@ -417,7 +415,7 @@
 
 extern IRExpr* IRExpr_Binder ( Int binder );
 extern IRExpr* IRExpr_Get    ( Int off, IRType ty );
-extern IRExpr* IRExpr_GetI   ( IRArray* descr, IRExpr* off, Int bias );
+extern IRExpr* IRExpr_GetI   ( IRArray* descr, IRExpr* ix, Int bias );
 extern IRExpr* IRExpr_Tmp    ( IRTemp tmp );
 extern IRExpr* IRExpr_Binop  ( IROp op, IRExpr* arg1, IRExpr* arg2 );
 extern IRExpr* IRExpr_Unop   ( IROp op, IRExpr* arg );
@@ -578,7 +576,7 @@
          } Put;
          struct {
             IRArray* descr;
-            IRExpr*  off;
+            IRExpr*  ix;
             Int      bias;
             IRExpr*  data;
          } PutI;
@@ -602,7 +600,7 @@
    IRStmt;
 
 extern IRStmt* IRStmt_Put   ( Int off, IRExpr* data );
-extern IRStmt* IRStmt_PutI  ( IRArray* descr, IRExpr* off, Int bias, 
+extern IRStmt* IRStmt_PutI  ( IRArray* descr, IRExpr* ix, Int bias, 
                               IRExpr* data );
 extern IRStmt* IRStmt_Tmp   ( IRTemp tmp, IRExpr* data );
 extern IRStmt* IRStmt_STle  ( IRExpr* addr, IRExpr* data );
@@ -682,7 +680,6 @@
 extern void  addStmtToIRBB ( IRBB*, IRStmt* );
 
 
-
 /*---------------------------------------------------------------*/
 /*--- Helper functions for the IR                             ---*/
 /*---------------------------------------------------------------*/
diff --git a/test_main.c b/test_main.c
index 6db4d3a..7ca579d 100644
--- a/test_main.c
+++ b/test_main.c
@@ -48,7 +48,7 @@
 static Bool verbose = True;
 
 /* Forwards */
-static IRBB* ac_instrument ( IRBB*, VexGuestLayoutInfo* );
+static IRBB* ac_instrument ( IRBB*, VexGuestLayout* );
 
 
 int main ( int argc, char** argv )
@@ -155,7 +155,7 @@
 }
 
 static
-IRBB* ac_instrument (IRBB* bb_in, VexGuestLayoutInfo* layout)
+IRBB* ac_instrument (IRBB* bb_in, VexGuestLayout* layout)
 {
 /* Use this rather than eg. -1 because it's a UInt. */
 #define INVALID_DATA_SIZE   999999
@@ -262,7 +262,7 @@
             break;
 
          case Ist_PutI:
-            assert(isAtom(st->Ist.PutI.off));
+            assert(isAtom(st->Ist.PutI.ix));
             assert(isAtom(st->Ist.PutI.data));
             break;