|
From: <sv...@va...> - 2012-09-21 09:04:39
|
tom 2012-09-21 10:04:27 +0100 (Fri, 21 Sep 2012)
New Revision: 13009
Log:
Rename CfiOp to CfiBinop in preparation for adding unary operators.
Modified files:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/storage.c
Modified: trunk/coregrind/m_debuginfo/priv_storage.h (+15 -15)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h 2012-09-21 09:57:46 +01:00 (rev 13008)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2012-09-21 10:04:27 +01:00 (rev 13009)
@@ -279,20 +279,20 @@
typedef
enum {
- Cop_Add=0x321,
- Cop_Sub,
- Cop_And,
- Cop_Mul,
- Cop_Shl,
- Cop_Shr,
- Cop_Eq,
- Cop_Ge,
- Cop_Gt,
- Cop_Le,
- Cop_Lt,
- Cop_Ne
+ Cbinop_Add=0x321,
+ Cbinop_Sub,
+ Cbinop_And,
+ Cbinop_Mul,
+ Cbinop_Shl,
+ Cbinop_Shr,
+ Cbinop_Eq,
+ Cbinop_Ge,
+ Cbinop_Gt,
+ Cbinop_Le,
+ Cbinop_Lt,
+ Cbinop_Ne
}
- CfiOp;
+ CfiBinop;
typedef
enum {
@@ -332,7 +332,7 @@
UWord con;
} Const;
struct {
- CfiOp op;
+ CfiBinop op;
Int ixL;
Int ixR;
} Binop;
@@ -350,7 +350,7 @@
extern Int ML_(CfiExpr_Undef) ( XArray* dst );
extern Int ML_(CfiExpr_Deref) ( XArray* dst, Int ixAddr );
extern Int ML_(CfiExpr_Const) ( XArray* dst, UWord con );
-extern Int ML_(CfiExpr_Binop) ( XArray* dst, CfiOp op, Int ixL, Int ixR );
+extern Int ML_(CfiExpr_Binop) ( XArray* dst, CfiBinop op, Int ixL, Int ixR );
extern Int ML_(CfiExpr_CfiReg)( XArray* dst, CfiReg reg );
extern Int ML_(CfiExpr_DwReg) ( XArray* dst, Int reg );
Modified: trunk/coregrind/m_debuginfo/storage.c (+16 -16)
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2012-09-21 09:57:46 +01:00 (rev 13008)
+++ trunk/coregrind/m_debuginfo/storage.c 2012-09-21 10:04:27 +01:00 (rev 13009)
@@ -585,7 +585,7 @@
e.Cex.Const.con = con;
return (Int)VG_(addToXA)( dst, &e );
}
-Int ML_(CfiExpr_Binop)( XArray* dst, CfiOp op, Int ixL, Int ixR )
+Int ML_(CfiExpr_Binop)( XArray* dst, CfiBinop op, Int ixL, Int ixR )
{
CfiExpr e;
VG_(memset)( &e, 0, sizeof(e) );
@@ -612,22 +612,22 @@
return (Int)VG_(addToXA)( dst, &e );
}
-static void ppCfiOp ( CfiOp op )
+static void ppCfiBinop ( CfiBinop op )
{
switch (op) {
- case Cop_Add: VG_(printf)("+"); break;
- case Cop_Sub: VG_(printf)("-"); break;
- case Cop_And: VG_(printf)("&"); break;
- case Cop_Mul: VG_(printf)("*"); break;
- case Cop_Shl: VG_(printf)("<<"); break;
- case Cop_Shr: VG_(printf)(">>"); break;
- case Cop_Eq: VG_(printf)("=="); break;
- case Cop_Ge: VG_(printf)(">="); break;
- case Cop_Gt: VG_(printf)(">"); break;
- case Cop_Le: VG_(printf)("<="); break;
- case Cop_Lt: VG_(printf)("<"); break;
- case Cop_Ne: VG_(printf)("!="); break;
- default: vg_assert(0);
+ case Cbinop_Add: VG_(printf)("+"); break;
+ case Cbinop_Sub: VG_(printf)("-"); break;
+ case Cbinop_And: VG_(printf)("&"); break;
+ case Cbinop_Mul: VG_(printf)("*"); break;
+ case Cbinop_Shl: VG_(printf)("<<"); break;
+ case Cbinop_Shr: VG_(printf)(">>"); break;
+ case Cbinop_Eq: VG_(printf)("=="); break;
+ case Cbinop_Ge: VG_(printf)(">="); break;
+ case Cbinop_Gt: VG_(printf)(">"); break;
+ case Cbinop_Le: VG_(printf)("<="); break;
+ case Cbinop_Lt: VG_(printf)("<"); break;
+ case Cbinop_Ne: VG_(printf)("!="); break;
+ default: vg_assert(0);
}
}
@@ -668,7 +668,7 @@
VG_(printf)("(");
ML_(ppCfiExpr)(src, e->Cex.Binop.ixL);
VG_(printf)(")");
- ppCfiOp(e->Cex.Binop.op);
+ ppCfiBinop(e->Cex.Binop.op);
VG_(printf)("(");
ML_(ppCfiExpr)(src, e->Cex.Binop.ixR);
VG_(printf)(")");
Modified: trunk/coregrind/m_debuginfo/readdwarf.c (+23 -23)
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2012-09-21 09:57:46 +01:00 (rev 13008)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2012-09-21 10:04:27 +01:00 (rev 13009)
@@ -2728,12 +2728,12 @@
sp--; \
} while (0)
- Int ix, ix2, reg;
- UChar opcode;
- Word sw;
- UWord uw;
- CfiOp op;
- HChar* opname;
+ Int ix, ix2, reg;
+ UChar opcode;
+ Word sw;
+ UWord uw;
+ CfiBinop bop;
+ HChar* opname;
Int sp; /* # of top element: valid is -1 .. N_EXPR_STACK-1 */
Int stack[N_EXPR_STACK]; /* indices into ctx->exprs */
@@ -2752,7 +2752,7 @@
if (ctxs->cfa_is_regoff) {
/* cfa is reg +/- offset */
ix = ML_(CfiExpr_Binop)( dst,
- Cop_Add,
+ Cbinop_Add,
ML_(CfiExpr_DwReg)( dst, ctxs->cfa_reg ),
ML_(CfiExpr_Const)( dst, (UWord)(Word)ctxs->cfa_off )
);
@@ -2778,7 +2778,7 @@
break;
}
- op = 0; opname = NULL; /* excessively conservative */
+ bop = 0; opname = NULL; /* excessively conservative */
opcode = *expr++;
switch (opcode) {
@@ -2798,7 +2798,7 @@
vg_assert(reg >= 0 && reg <= 31);
sw = read_leb128S( &expr );
ix = ML_(CfiExpr_Binop)( dst,
- Cop_Add,
+ Cbinop_Add,
ML_(CfiExpr_DwReg)( dst, reg ),
ML_(CfiExpr_Const)( dst, (UWord)sw )
);
@@ -2822,7 +2822,7 @@
PUSH( ML_(CfiExpr_Const)( dst, uw ) );
POP( ix );
POP( ix2 );
- PUSH( ML_(CfiExpr_Binop)( dst, Cop_Add, ix2, ix ) );
+ PUSH( ML_(CfiExpr_Binop)( dst, Cbinop_Add, ix2, ix ) );
if (ddump_frames)
VG_(printf)("DW_OP_plus_uconst: %lu", uw);
break;
@@ -2846,33 +2846,33 @@
break;
case DW_OP_minus:
- op = Cop_Sub; opname = "minus"; goto binop;
+ bop = Cbinop_Sub; opname = "minus"; goto binop;
case DW_OP_plus:
- op = Cop_Add; opname = "plus"; goto binop;
+ bop = Cbinop_Add; opname = "plus"; goto binop;
case DW_OP_and:
- op = Cop_And; opname = "and"; goto binop;
+ bop = Cbinop_And; opname = "and"; goto binop;
case DW_OP_mul:
- op = Cop_Mul; opname = "mul"; goto binop;
+ bop = Cbinop_Mul; opname = "mul"; goto binop;
case DW_OP_shl:
- op = Cop_Shl; opname = "shl"; goto binop;
+ bop = Cbinop_Shl; opname = "shl"; goto binop;
case DW_OP_shr:
- op = Cop_Shr; opname = "shr"; goto binop;
+ bop = Cbinop_Shr; opname = "shr"; goto binop;
case DW_OP_eq:
- op = Cop_Eq; opname = "eq"; goto binop;
+ bop = Cbinop_Eq; opname = "eq"; goto binop;
case DW_OP_ge:
- op = Cop_Ge; opname = "ge"; goto binop;
+ bop = Cbinop_Ge; opname = "ge"; goto binop;
case DW_OP_gt:
- op = Cop_Gt; opname = "gt"; goto binop;
+ bop = Cbinop_Gt; opname = "gt"; goto binop;
case DW_OP_le:
- op = Cop_Le; opname = "le"; goto binop;
+ bop = Cbinop_Le; opname = "le"; goto binop;
case DW_OP_lt:
- op = Cop_Lt; opname = "lt"; goto binop;
+ bop = Cbinop_Lt; opname = "lt"; goto binop;
case DW_OP_ne:
- op = Cop_Ne; opname = "ne"; goto binop;
+ bop = Cbinop_Ne; opname = "ne"; goto binop;
binop:
POP( ix );
POP( ix2 );
- PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) );
+ PUSH( ML_(CfiExpr_Binop)( dst, bop, ix2, ix ) );
if (ddump_frames)
VG_(printf)("DW_OP_%s", opname);
break;
Modified: trunk/coregrind/m_debuginfo/debuginfo.c (+12 -12)
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2012-09-21 09:57:46 +01:00 (rev 13008)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2012-09-21 10:04:27 +01:00 (rev 13009)
@@ -2063,18 +2063,18 @@
wR = evalCfiExpr( exprs, e->Cex.Binop.ixR, eec, ok );
if (!(*ok)) return 0;
switch (e->Cex.Binop.op) {
- case Cop_Add: return wL + wR;
- case Cop_Sub: return wL - wR;
- case Cop_And: return wL & wR;
- case Cop_Mul: return wL * wR;
- case Cop_Shl: return wL << wR;
- case Cop_Shr: return wL >> wR;
- case Cop_Eq: return wL == wR ? 1 : 0;
- case Cop_Ge: return (Word) wL >= (Word) wR ? 1 : 0;
- case Cop_Gt: return (Word) wL > (Word) wR ? 1 : 0;
- case Cop_Le: return (Word) wL <= (Word) wR ? 1 : 0;
- case Cop_Lt: return (Word) wL < (Word) wR ? 1 : 0;
- case Cop_Ne: return wL != wR ? 1 : 0;
+ case Cbinop_Add: return wL + wR;
+ case Cbinop_Sub: return wL - wR;
+ case Cbinop_And: return wL & wR;
+ case Cbinop_Mul: return wL * wR;
+ case Cbinop_Shl: return wL << wR;
+ case Cbinop_Shr: return wL >> wR;
+ case Cbinop_Eq: return wL == wR ? 1 : 0;
+ case Cbinop_Ge: return (Word) wL >= (Word) wR ? 1 : 0;
+ case Cbinop_Gt: return (Word) wL > (Word) wR ? 1 : 0;
+ case Cbinop_Le: return (Word) wL <= (Word) wR ? 1 : 0;
+ case Cbinop_Lt: return (Word) wL < (Word) wR ? 1 : 0;
+ case Cbinop_Ne: return wL != wR ? 1 : 0;
default: goto unhandled;
}
/*NOTREACHED*/
|