Moved the following macros, which were defined multiple times in multiple
files, into vg_skin.h:

    uInstr0, uInstr1, uInstr2, uInstr3, nameIReg, nameISize, nameSReg,
    newTemp, newShadow, uLiteral, uCCall

As macros they avoid namespace problems (they expand to VG_(whatever)) so
this should work fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1182 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_include.h b/addrcheck/ac_include.h
index 1a47e4e..4d6842b 100644
--- a/addrcheck/ac_include.h
+++ b/addrcheck/ac_include.h
@@ -91,8 +91,6 @@
 /*--- Functions                                            ---*/
 /*------------------------------------------------------------*/
 
-// SSS: work out a consistent prefix convention here
-
 /* Functions defined in vg_addrcheck.c */
 extern void SK_(helperc_ACCESS4) ( Addr );
 extern void SK_(helperc_ACCESS2) ( Addr );
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index ac38e9b..5098133 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -1731,12 +1731,6 @@
 /*--- Our instrumenter                                     ---*/
 /*------------------------------------------------------------*/
 
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uLiteral  VG_(set_lit_field)
-#define uCCall    VG_(set_ccall_fields)
-#define newTemp   VG_(get_new_temp)
-
 UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
 {
 /* Use this rather than eg. -1 because it's a UInt. */
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index fbbcc5e..14e5ae2 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -483,14 +483,6 @@
 /*--- Cache simulation instrumentation phase               ---*/
 /*------------------------------------------------------------*/
 
-// SSS: do something about all these...
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uInstr3   VG_(new_UInstr3)
-#define uLiteral  VG_(set_lit_field)
-#define uCCall    VG_(set_ccall_fields)
-#define newTemp   VG_(get_new_temp)
-
 static Int compute_BBCC_array_size(UCodeBlock* cb)
 {
    UInstr* u_in;
diff --git a/coregrind/vg_from_ucode.c b/coregrind/vg_from_ucode.c
index 0c11f03..aadbe1f 100644
--- a/coregrind/vg_from_ucode.c
+++ b/coregrind/vg_from_ucode.c
@@ -36,9 +36,6 @@
 /*--- Renamings of frequently-used global functions.       ---*/
 /*------------------------------------------------------------*/
 
-#define nameIReg  VG_(name_of_int_reg)
-#define nameISize VG_(name_of_int_size)
-
 #define dis       VG_(print_codegen)
 
 /*------------------------------------------------------------*/
diff --git a/coregrind/vg_instrument.c b/coregrind/vg_instrument.c
index 94a8a41..80dd5f0 100644
--- a/coregrind/vg_instrument.c
+++ b/coregrind/vg_instrument.c
@@ -39,13 +39,6 @@
    couldn't otherwise do. */
 #include "vg_skin.h"
 
-#define uInstr0   VG_(new_UInstr0)
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uLiteral  VG_(set_lit_field)
-#define uCCall    VG_(set_ccall_fields)
-#define newTemp   VG_(get_new_temp)
-
 
 void VG_(call_helper_0_0)(UCodeBlock* cb, Addr f)
 {
diff --git a/coregrind/vg_to_ucode.c b/coregrind/vg_to_ucode.c
index ae46414..3a04c0a 100644
--- a/coregrind/vg_to_ucode.c
+++ b/coregrind/vg_to_ucode.c
@@ -36,16 +36,6 @@
 /*--- Renamings of frequently-used global functions.       ---*/
 /*------------------------------------------------------------*/
 
-#define uInstr0   VG_(new_UInstr0)
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uInstr3   VG_(new_UInstr3)
-#define nameIReg  VG_(name_of_int_reg)
-#define nameISize VG_(name_of_int_size)
-#define nameSReg  VG_(name_of_seg_reg)
-#define newTemp   VG_(get_new_temp)
-#define uLiteral  VG_(set_lit_field)
-
 #define dis       VG_(print_codegen)
 
 
diff --git a/coregrind/vg_translate.c b/coregrind/vg_translate.c
index e9c4a26..9c2f51e 100644
--- a/coregrind/vg_translate.c
+++ b/coregrind/vg_translate.c
@@ -35,11 +35,6 @@
 /*--- Renamings of frequently-used global functions.       ---*/
 /*------------------------------------------------------------*/
 
-#define uInstr2   VG_(new_UInstr2)
-#define nameIReg  VG_(name_of_int_reg)
-#define nameISize VG_(name_of_int_size)
-#define nameSReg  VG_(name_of_seg_reg)
-
 #define dis       VG_(print_codegen)
 
 
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index 68276e1..1a37d20 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -860,12 +860,6 @@
 /*--- Instrumentation                                        ---*/
 /*--------------------------------------------------------------*/
 
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uLiteral  VG_(set_lit_field)
-#define uCCall    VG_(set_ccall_fields)
-#define newTemp   VG_(get_new_temp)
-
 /* Create and return an instrumented version of cb_in.  Free cb_in
    before returning. */
 UCodeBlock* SK_(instrument) ( UCodeBlock* cb_in, Addr not_used )
diff --git a/include/vg_skin.h b/include/vg_skin.h
index 68da7f2..ceb2536 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -737,6 +737,16 @@
 
 extern Bool VG_(any_flag_use)( UInstr* u );
 
+/* Macro versions of the above;  just shorter to type. */
+#define uInstr0   VG_(new_UInstr0)
+#define uInstr1   VG_(new_UInstr1)
+#define uInstr2   VG_(new_UInstr2)
+#define uInstr3   VG_(new_UInstr3)
+#define uLiteral  VG_(set_lit_field)
+#define uCCall    VG_(set_ccall_fields)
+#define newTemp   VG_(get_new_temp)
+#define newShadow VG_(get_new_shadow)
+
 /* Refer to `the last instruction stuffed in' (can be lvalue). */
 #define LAST_UINSTR(cb) (cb)->instrs[(cb)->used-1]
 
@@ -813,6 +823,11 @@
 extern Char* VG_(name_of_int_reg)  ( Int size, Int reg );
 extern Char  VG_(name_of_int_size) ( Int size );
 
+/* Shorter macros for convenience */
+#define nameIReg  VG_(name_of_int_reg)
+#define nameISize VG_(name_of_int_size)
+#define nameSReg  VG_(name_of_seg_reg)
+
 /* Randomly useful things */
 extern UInt  VG_(extend_s_8to32) ( UInt x );
 
diff --git a/lackey/lk_main.c b/lackey/lk_main.c
index 6679541..b33e65f 100644
--- a/lackey/lk_main.c
+++ b/lackey/lk_main.c
@@ -31,9 +31,6 @@
 
 #include "vg_skin.h"
 
-//#define uInstr0   VG_(new_UInstr0)
-//#define uLiteral  VG_(set_lit_field)
-
 /* Nb: use ULongs because the numbers can get very big */
 static ULong n_dlrr_calls   = 0;
 static ULong n_BBs          = 0;
diff --git a/memcheck/mc_from_ucode.c b/memcheck/mc_from_ucode.c
index 59fe6e4..8d63166 100644
--- a/memcheck/mc_from_ucode.c
+++ b/memcheck/mc_from_ucode.c
@@ -35,9 +35,6 @@
 /*--- Renamings of frequently-used global functions.       ---*/
 /*------------------------------------------------------------*/
 
-#define nameIReg  VG_(name_of_int_reg)
-#define nameISize VG_(name_of_int_size)
-
 #define dis       VG_(print_codegen)
 
 /*------------------------------------------------------------*/
diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c
index 9c3474c..88f34ab 100644
--- a/memcheck/mc_translate.c
+++ b/memcheck/mc_translate.c
@@ -270,14 +270,6 @@
 /*--- New instrumentation machinery.                       ---*/
 /*------------------------------------------------------------*/
 
-#define uInstr1   VG_(new_UInstr1)
-#define uInstr2   VG_(new_UInstr2)
-#define uInstr3   VG_(new_UInstr3)
-#define uLiteral  VG_(set_lit_field)
-#define uCCall    VG_(set_ccall_fields)
-#define newTemp   VG_(get_new_temp)
-#define newShadow VG_(get_new_shadow)
-
 static
 TagOp get_Tag_ImproveOR_TQ ( Int sz )
 {