]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Constify VEX's external interface.
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 21 Oct 2012 02:09:51 +0000 (02:09 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 21 Oct 2012 02:09:51 +0000 (02:09 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2555

20 files changed:
VEX/priv/guest_amd64_defs.h
VEX/priv/guest_amd64_helpers.c
VEX/priv/guest_arm_defs.h
VEX/priv/guest_arm_helpers.c
VEX/priv/guest_mips_defs.h
VEX/priv/guest_mips_helpers.c
VEX/priv/guest_ppc_defs.h
VEX/priv/guest_ppc_helpers.c
VEX/priv/guest_s390_defs.h
VEX/priv/guest_s390_helpers.c
VEX/priv/guest_x86_defs.h
VEX/priv/guest_x86_helpers.c
VEX/priv/host_s390_defs.c
VEX/priv/host_s390_defs.h
VEX/priv/ir_defs.c
VEX/priv/ir_opt.c
VEX/priv/ir_opt.h
VEX/priv/main_main.c
VEX/pub/libvex_emnote.h
VEX/pub/libvex_ir.h

index f44c6f89eab2638c41f491dc87b666502205df6a..bbcc95f60a92b549ffbff77063a67f00fb8b2167 100644 (file)
@@ -64,7 +64,7 @@ DisResult disInstr_AMD64 ( IRSB*        irbb,
 
 /* Used by the optimiser to specialise calls to helpers. */
 extern
-IRExpr* guest_amd64_spechelper ( HChar*   function_name,
+IRExpr* guest_amd64_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts );
index 4b3508b2f602831c22612e6e683a047f1bb6a09e..5f2c6c5d5ec05c46140fbbf549af7de0a6c43b81 100644 (file)
@@ -870,7 +870,7 @@ static Bool isU64 ( IRExpr* e, ULong n )
                   && e->Iex.Const.con->Ico.U64 == n );
 }
 
-IRExpr* guest_amd64_spechelper ( HChar* function_name,
+IRExpr* guest_amd64_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts )
index 1325991deaf5a76e94139ec59533392d6ae4c753..e064b40bc548d12996c6ad8459b8245ac9ba38e1 100644 (file)
@@ -56,7 +56,7 @@ DisResult disInstr_ARM ( IRSB*        irbb,
 
 /* Used by the optimiser to specialise calls to helpers. */
 extern
-IRExpr* guest_arm_spechelper ( HChar*   function_name,
+IRExpr* guest_arm_spechelper ( const HChar* function_name,
                                IRExpr** args,
                                IRStmt** precedingStmts,
                                Int      n_precedingStmts );
index 5c5d35055d2139c4087772e1b2bc39671f7493b8..2c452e35e050ac0a11da2e796c65739941458aac 100644 (file)
@@ -551,7 +551,7 @@ static Bool isU32 ( IRExpr* e, UInt n )
               && e->Iex.Const.con->Ico.U32 == n );
 }
 
-IRExpr* guest_arm_spechelper ( HChar*   function_name,
+IRExpr* guest_arm_spechelper ( const HChar* function_name,
                                IRExpr** args,
                                IRStmt** precedingStmts,
                                Int      n_precedingStmts )
index 8977f2ecc9b70867211ab184d4e7bd0f6ceb4cb8..74f1259e36314be11ef519753221588db9d4bc87 100644 (file)
@@ -55,7 +55,7 @@ extern DisResult disInstr_MIPS ( IRSB*        irbb,
                                  Bool         host_bigendian );
 
 /* Used by the optimiser to specialise calls to helpers. */
-extern IRExpr *guest_mips32_spechelper(HChar * function_name, IRExpr ** args,
+extern IRExpr *guest_mips32_spechelper(const HChar * function_name, IRExpr ** args,
                                        IRStmt ** precedingStmts,
                                        Int n_precedingStmts);
 
index 0606ed5ae93acb992fdeb7b9c9143302c3eb0e47..61b16465f44c26a08d2faee1e073d299066ec20d 100644 (file)
@@ -47,7 +47,7 @@
     { offsetof(VexGuestMIPS32State, field),            \
       (sizeof ((VexGuestMIPS32State*)0)->field) }
 
-IRExpr *guest_mips32_spechelper(HChar * function_name, IRExpr ** args,
+IRExpr *guest_mips32_spechelper(const HChar * function_name, IRExpr ** args,
                                 IRStmt ** precedingStmts, Int n_precedingStmts)
 {
    return NULL;
index 7ce6cf562b19d360f6812d7a9c554cfe9763b5cc..00b4ee7529a936e78d98fc5b1528e0c8abf45b40 100644 (file)
@@ -65,13 +65,13 @@ DisResult disInstr_PPC ( IRSB*        irbb,
 
 /* Used by the optimiser to specialise calls to helpers. */
 extern
-IRExpr* guest_ppc32_spechelper ( HChar*   function_name,
+IRExpr* guest_ppc32_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts );
 
 extern
-IRExpr* guest_ppc64_spechelper ( HChar*   function_name,
+IRExpr* guest_ppc64_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts );
index bb1bd79ef2ea9996cc994d63b29ed997e03af336..906f9b4546989470fcbb24be4ba32455bd87019a 100644 (file)
@@ -188,7 +188,7 @@ void ppc64g_dirtyhelper_LVS ( VexGuestPPC64State* gst,
 
 /* Helper-function specialiser. */
 
-IRExpr* guest_ppc32_spechelper ( HChar* function_name,
+IRExpr* guest_ppc32_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts )
@@ -196,7 +196,7 @@ IRExpr* guest_ppc32_spechelper ( HChar* function_name,
    return NULL;
 }
 
-IRExpr* guest_ppc64_spechelper ( HChar* function_name,
+IRExpr* guest_ppc64_spechelper ( const HChar* function_name,
                                  IRExpr** args,
                                  IRStmt** precedingStmts,
                                  Int      n_precedingStmts )
index de59f95746e43d477b0611d342d8174339a6774c..f28151c454955bba8d5993996057ceed8348d9a4 100644 (file)
@@ -53,7 +53,7 @@ DisResult disInstr_S390 ( IRSB*        irbb,
                           Bool         host_bigendian );
 
 /* Used by the optimiser to specialise calls to helpers. */
-IRExpr* guest_s390x_spechelper ( HChar   *function_name,
+IRExpr* guest_s390x_spechelper ( const HChar *function_name,
                                  IRExpr **args,
                                  IRStmt **precedingStmts,
                                  Int n_precedingStmts);
index 66f05fef36c20e50f7f8bae69ec7b8777c99bc95..eaddd29342c7599911cd6dbc9cb310167f719c96 100644 (file)
@@ -1375,7 +1375,7 @@ isC64(IRExpr *expr)
    case the helper function will be called. Otherwise, the expression has
    type Ity_I32 and a Boolean value. */
 IRExpr *
-guest_s390x_spechelper(HChar *function_name, IRExpr **args,
+guest_s390x_spechelper(const HChar *function_name, IRExpr **args,
                        IRStmt **precedingStmts, Int n_precedingStmts)
 {
    UInt i, arity = 0;
index d982612e27fe6f9aae192bfa500eff7771283c33..af83cb7a3d5fd5cfd7b1615f60bb2986cbfafedf 100644 (file)
@@ -64,7 +64,7 @@ DisResult disInstr_X86 ( IRSB*        irbb,
 
 /* Used by the optimiser to specialise calls to helpers. */
 extern
-IRExpr* guest_x86_spechelper ( HChar*   function_name,
+IRExpr* guest_x86_spechelper ( const HChar* function_name,
                                IRExpr** args,
                                IRStmt** precedingStmts,
                                Int      n_precedingStmts );
index 1ae1d3cf132b4f29330a4dc6e1bc6cf1459fe114..46762766183cee992cf331839c1b5f6ab3227b39 100644 (file)
@@ -773,7 +773,7 @@ static inline Bool isU32 ( IRExpr* e, UInt n )
               && e->Iex.Const.con->Ico.U32 == n );
 }
 
-IRExpr* guest_x86_spechelper ( HChar*   function_name,
+IRExpr* guest_x86_spechelper ( const HChar* function_name,
                                IRExpr** args,
                                IRStmt** precedingStmts,
                                Int      n_precedingStmts )
index 3ffe0eb58c5e94b24eb638dc3712e73667e0c985..279d83d7ab084da2c041bb758e9aac35746056ce 100644 (file)
@@ -4644,7 +4644,7 @@ s390_insn_compare(UChar size, HReg src1, s390_opnd_RMI src2,
 
 s390_insn *
 s390_insn_helper_call(s390_cc_t cond, Addr64 target, UInt num_args,
-                      HChar *name, HReg dst)
+                      const HChar *name, HReg dst)
 {
    s390_insn *insn = LibVEX_Alloc(sizeof(s390_insn));
 
index 6034b48dce5633becbbd60c0dbe0f6e41aca1b48..37a7dc9bf7881bcd89d47da988e6c64a74b61a44 100644 (file)
@@ -387,11 +387,11 @@ typedef struct {
          i.e. in registers r2, r3, r4, r5, and r6, with argument #0 being
          passed in r2 and so forth. */
       struct {
-         s390_cc_t cond;
-         Addr64    target;
-         UInt      num_args;
-         HReg      dst;       /* if not INVALID_HREG, put return value here */
-         HChar    *name;      /* callee's name (for debugging) */
+         s390_cc_t    cond;
+         Addr64       target;
+         UInt         num_args;
+         HReg         dst;       /* if not INVALID_HREG, put return value here */
+         const HChar *name;      /* callee's name (for debugging) */
       } helper_call;
 
       /* Floating point instructions (including conversion to/from floating
@@ -532,7 +532,7 @@ s390_insn *s390_insn_test(UChar size, s390_opnd_RMI src);
 s390_insn *s390_insn_compare(UChar size, HReg dst, s390_opnd_RMI opnd,
                              Bool signed_comparison);
 s390_insn *s390_insn_helper_call(s390_cc_t cond, Addr64 target, UInt num_args,
-                                 HChar *name, HReg dst);
+                                 const HChar *name, HReg dst);
 s390_insn *s390_insn_bfp_triop(UChar size, s390_bfp_triop_t, HReg dst,
                                HReg op2, HReg op3);
 s390_insn *s390_insn_bfp_binop(UChar size, s390_bfp_binop_t, HReg dst,
index 0d0d151d5f47dbf5bd539cbd8be251efa7a0a000..99b2266c23542efcfa0f981b40e55d5879eabceb 100644 (file)
@@ -118,7 +118,7 @@ void ppIRTemp ( IRTemp tmp )
 
 void ppIROp ( IROp op )
 {
-   HChar* str = NULL; 
+   const HChar* str = NULL; 
    IROp   base;
    switch (op) {
       case Iop_Add8 ... Iop_Add64:
@@ -1461,7 +1461,7 @@ IRConst* IRConst_V256 ( UInt con )
 
 /* Constructors -- IRCallee */
 
-IRCallee* mkIRCallee ( Int regparms, HChar* name, void* addr )
+IRCallee* mkIRCallee ( Int regparms, const HChar* name, void* addr )
 {
    IRCallee* ce = LibVEX_Alloc(sizeof(IRCallee));
    ce->regparms = regparms;
@@ -3138,7 +3138,7 @@ static inline Int countArgs ( IRExpr** args )
 
 static
 __attribute((noreturn))
-void sanityCheckFail ( IRSB* bb, IRStmt* stmt, HChar* what )
+void sanityCheckFail ( IRSB* bb, IRStmt* stmt, const HChar* what )
 {
    vex_printf("\nIR SANITY CHECK FAILURE\n\n");
    ppIRSB(bb);
@@ -3738,7 +3738,7 @@ void tcStmt ( IRSB* bb, IRStmt* stmt, IRType gWordTy )
    }
 }
 
-void sanityCheckIRSB ( IRSB* bb,          HChar* caller,
+void sanityCheckIRSB ( IRSB* bb,          const HChar* caller,
                        Bool require_flat, IRType guest_word_size )
 {
    Int     i;
@@ -3927,7 +3927,7 @@ IRExpr* mkIRExpr_HWord ( HWord hw )
    vpanic("mkIRExpr_HWord");
 }
 
-IRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr, 
+IRDirty* unsafeIRDirty_0_N ( Int regparms, const HChar* name, void* addr, 
                              IRExpr** args ) 
 {
    IRDirty* d = emptyIRDirty();
@@ -3938,7 +3938,7 @@ IRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr,
 }
 
 IRDirty* unsafeIRDirty_1_N ( IRTemp dst, 
-                             Int regparms, HChar* name, void* addr, 
+                             Int regparms, const HChar* name, void* addr, 
                              IRExpr** args ) 
 {
    IRDirty* d = emptyIRDirty();
@@ -3950,7 +3950,7 @@ IRDirty* unsafeIRDirty_1_N ( IRTemp dst,
 }
 
 IRExpr* mkIRExprCCall ( IRType retty,
-                        Int regparms, HChar* name, void* addr, 
+                        Int regparms, const HChar* name, void* addr, 
                         IRExpr** args )
 {
    return IRExpr_CCall ( mkIRCallee ( regparms, name, addr ), 
index d53db40e0d4a2534cebb95cbc97dc06102f2edec..b7e3d9a75d2c73a3fcd4c408ad427dc2794badfa 100644 (file)
@@ -2811,7 +2811,7 @@ static Bool isOneU1 ( IRExpr* e )
 static 
 IRSB* spec_helpers_BB(
          IRSB* bb,
-         IRExpr* (*specHelper) (HChar*, IRExpr**, IRStmt**, Int)
+         IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int)
       )
 {
    Int     i;
@@ -5294,7 +5294,7 @@ static Bool iropt_verbose = False; /* True; */
 static 
 IRSB* cheap_transformations ( 
          IRSB* bb,
-         IRExpr* (*specHelper) (HChar*, IRExpr**, IRStmt**, Int),
+         IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int),
          Bool (*preciseMemExnsFn)(Int,Int)
       )
 {
@@ -5455,7 +5455,7 @@ static void considerExpensives ( /*OUT*/Bool* hasGetIorPutI,
 
 IRSB* do_iropt_BB(
          IRSB* bb0,
-         IRExpr* (*specHelper) (HChar*, IRExpr**, IRStmt**, Int),
+         IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int),
          Bool (*preciseMemExnsFn)(Int,Int),
          Addr64 guest_addr,
          VexArch guest_arch
index c215fa2645932d8915501c65f8a38ae159311bd5..9a40c0e89f2fb2f213b00540823b1d9c529d34e8 100644 (file)
@@ -45,7 +45,7 @@
 extern 
 IRSB* do_iropt_BB(
          IRSB* bb,
-         IRExpr* (*specHelper) (HChar*, IRExpr**, IRStmt**, Int),
+         IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int),
          Bool (*preciseMemExnsFn)(Int,Int),
          Addr64 guest_addr,
          VexArch guest_arch
index 8d812586e2c80884494357966a136d0c6682ed73..cf66cf1abc409167f3f009dbfe8d33d4a2ac56ca 100644 (file)
@@ -203,7 +203,7 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta )
    Int          (*emit)         ( /*MB_MOD*/Bool*,
                                   UChar*, Int, HInstr*, Bool,
                                   void*, void*, void*, void* );
-   IRExpr*      (*specHelper)   ( HChar*, IRExpr**, IRStmt**, Int );
+   IRExpr*      (*specHelper)   ( const HChar*, IRExpr**, IRStmt**, Int );
    Bool         (*preciseMemExnsFn) ( Int, Int );
 
    DisOneInstrFn disInstrFn;
@@ -1005,7 +1005,7 @@ VexInvalRange LibVEX_PatchProfInc ( VexArch arch_host,
 
 /* --------- Emulation warnings. --------- */
 
-HChar* LibVEX_EmNote_string ( VexEmNote ew )
+const HChar* LibVEX_EmNote_string ( VexEmNote ew )
 {
    switch (ew) {
      case EmNote_NONE: 
index abcedc1a8d47f5445a9d722ef11d356c1f2b45db..091b3b76433cf85e6f418cc54b6d8752e5f5dc7d 100644 (file)
@@ -113,7 +113,7 @@ typedef
 
 
 /* Produces a short string describing the warning. */
-extern HChar* LibVEX_EmNote_string ( VexEmNote );
+extern const HChar* LibVEX_EmNote_string ( VexEmNote );
 
 
 #endif /* ndef __LIBVEX_EMNOTE_H */
index 3ab417a12a4b0cbcab170c108e8de75842b9af8c..f399bb25cdbb9b2f97df18d5b12ce25bbb144e06 100644 (file)
@@ -344,15 +344,15 @@ extern Bool eqIRConst ( IRConst*, IRConst* );
 
 typedef
    struct {
-      Int    regparms;
-      HChar* name;
-      void*  addr;
-      UInt   mcx_mask;
+      Int          regparms;
+      const HChar* name;
+      void*        addr;
+      UInt         mcx_mask;
    }
    IRCallee;
 
 /* Create an IRCallee. */
-extern IRCallee* mkIRCallee ( Int regparms, HChar* name, void* addr );
+extern IRCallee* mkIRCallee ( Int regparms, const HChar* name, void* addr );
 
 /* Deep-copy an IRCallee. */
 extern IRCallee* deepCopyIRCallee ( IRCallee* );
@@ -1813,7 +1813,7 @@ extern IRExpr* mkIRExpr_HWord ( HWord );
 /* Convenience function for constructing clean helper calls. */
 extern 
 IRExpr* mkIRExprCCall ( IRType retty,
-                        Int regparms, HChar* name, void* addr, 
+                        Int regparms, const HChar* name, void* addr, 
                         IRExpr** args );
 
 
@@ -2008,14 +2008,14 @@ extern IRDirty* deepCopyIRDirty ( IRDirty* );
    designation) -- you can change this marking later if need be.  A
    suitable IRCallee is constructed from the supplied bits. */
 extern 
-IRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr, 
+IRDirty* unsafeIRDirty_0_N ( Int regparms, const HChar* name, void* addr, 
                              IRExpr** args );
 
 /* Similarly, make a zero-annotation dirty call which returns a value,
    and assign that to the given temp. */
 extern 
 IRDirty* unsafeIRDirty_1_N ( IRTemp dst, 
-                             Int regparms, HChar* name, void* addr, 
+                             Int regparms, const HChar* name, void* addr, 
                              IRExpr** args );
 
 
@@ -2498,7 +2498,7 @@ extern IRType typeOfIRExpr  ( IRTypeEnv*, IRExpr* );
 
 /* Sanity check a BB of IR */
 extern void sanityCheckIRSB ( IRSB*  bb, 
-                              HChar* caller,
+                              const  HChar* caller,
                               Bool   require_flatness, 
                               IRType guest_word_size );
 extern Bool isFlatIRStmt ( IRStmt* );