From: Nicholas Nethercote Date: Fri, 4 Oct 2002 14:34:15 +0000 (+0000) Subject: Moved the following macros, which were defined multiple times in multiple X-Git-Tag: svn/VALGRIND_1_9_4~245 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=534ab14977f9aa484098e24a36ae9cd7004f7dac;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/addrcheck/ac_include.h b/addrcheck/ac_include.h index 1a47e4e811..4d6842b4c4 100644 --- a/addrcheck/ac_include.h +++ b/addrcheck/ac_include.h @@ -91,8 +91,6 @@ extern Bool SK_(clo_workaround_gcc296_bugs); /*--- 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 ac38e9bad9..50981331fe 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -1731,12 +1731,6 @@ void SK_(alt_free) ( ShadowChunk* sc, ThreadState* tst ) /*--- 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 fbbcc5ea79..14e5ae24b7 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -483,14 +483,6 @@ static __inline__ BBCC* get_BBCC(Addr bb_orig_addr, UCodeBlock* cb, /*--- 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 0c11f03dce..aadbe1f8c1 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 94a8a413f8..80dd5f0564 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 ae46414a92..3a04c0a2c1 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 e9c4a2601b..9c2f51ed66 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 68276e164e..1a37d202c2 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -860,12 +860,6 @@ Bool SK_(expensive_sanity_check)(void) /*--- 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 68da7f2a52..ceb2536dfb 100644 --- a/include/vg_skin.h +++ b/include/vg_skin.h @@ -737,6 +737,16 @@ extern void VG_(copy_UInstr) ( UCodeBlock* cb, UInstr* instr ); 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_seg_reg) ( Int sreg ); 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 6679541e3a..b33e65fa98 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 59fe6e4d3a..8d63166219 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 9c3474cfd2..88f34ab59a 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -270,14 +270,6 @@ Int SK_(get_Xreg_usage)(UInstr* u, Tag tag, RegUse* arr) /*--- 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 ) {