From: Julian Seward Date: Mon, 21 Mar 2005 01:35:02 +0000 (+0000) Subject: Bring in the beginnings of 64-bit cleanness for IR mangling in cachegrind: X-Git-Tag: svn/VALGRIND_3_0_0~920 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46306cdcb30dc10d4519ee70a5452fddd05de24b;p=thirdparty%2Fvalgrind.git Bring in the beginnings of 64-bit cleanness for IR mangling in cachegrind: * use mkIRExpr_HWord to wrap constants * add a bunch of paranoia to check we're not screwing up too obviously git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3398 --- diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 40fd86c3c5..b4ec110eb7 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -491,15 +491,33 @@ void endOfInstr(IRBB* bbOut, instr_info* i_node, Bool bbSeenBefore, Int argc; Char* helperName; void* helperAddr; + IRType wordTy; + + // Stay sane ... + tl_assert(sizeof(HWord) == sizeof(void*)); + if (sizeof(HWord) == 4) { + wordTy = Ity_I32; + } else + if (sizeof(HWord) == 8) { + wordTy = Ity_I64; + } else { + VG_(tool_panic)("endOfInstr: strange word size"); + } + + if (loadAddrExpr) + tl_assert(wordTy == typeOfIRExpr(bbOut->tyenv, loadAddrExpr)); + if (storeAddrExpr) + tl_assert(wordTy == typeOfIRExpr(bbOut->tyenv, storeAddrExpr)); + // Nb: instrLen will be zero if Vex failed to decode it. tl_assert( 0 == instrLen || (instrLen >= MIN_INSTR_SIZE && instrLen <= MAX_INSTR_SIZE) ); // Setup 1st arg: instr_info node's address - // XXX: not 64-bit clean + // Believed to be 64-bit clean do_details(i_node, bbSeenBefore, instrAddr, instrLen, dataSize ); - arg1 = IRExpr_Const(IRConst_U32( (UInt)i_node )); + arg1 = mkIRExpr_HWord( (HWord)i_node ); if (!loadAddrExpr && !storeAddrExpr) { // no load/store