/* Look up key in the map. */
-static Bool lookupHHW ( HashHW* h, /*OUT*/HWord* val, HWord key )
+static Bool lookupHHW ( const HashHW* h, /*OUT*/HWord* val, HWord key )
{
Int i;
/* vex_printf("lookupHHW(%llx)\n", key ); */
/* Non-critical helper, heuristic for reducing the number of tmp-tmp
copies made by flattening. If in doubt return False. */
-static Bool isFlat ( IRExpr* e )
+static Bool isFlat ( const IRExpr* e )
{
if (e->tag == Iex_Get)
return True;
/* Extract the min/max offsets from a guest state array descriptor. */
inline
-static void getArrayBounds ( IRRegArray* descr,
+static void getArrayBounds ( const IRRegArray* descr,
UInt* minoff, UInt* maxoff )
{
*minoff = descr->base;
return (minoff << 16) | maxoff;
}
-static UInt mk_key_GetIPutI ( IRRegArray* descr )
+static UInt mk_key_GetIPutI ( const IRRegArray* descr )
{
UInt minoff, maxoff;
getArrayBounds( descr, &minoff, &maxoff );
slower out of line general case. Saves a few insns. */
__attribute__((noinline))
-static Bool sameIRExprs_aux2 ( IRExpr** env, IRExpr* e1, IRExpr* e2 );
+static Bool sameIRExprs_aux2 ( IRExpr** env, const IRExpr* e1, const IRExpr* e2 );
inline
-static Bool sameIRExprs_aux ( IRExpr** env, IRExpr* e1, IRExpr* e2 )
+static Bool sameIRExprs_aux ( IRExpr** env, const IRExpr* e1, const IRExpr* e2 )
{
if (e1->tag != e2->tag) return False;
return sameIRExprs_aux2(env, e1, e2);
}
__attribute__((noinline))
-static Bool sameIRExprs_aux2 ( IRExpr** env, IRExpr* e1, IRExpr* e2 )
+static Bool sameIRExprs_aux2 ( IRExpr** env, const IRExpr* e1, const IRExpr* e2 )
{
if (num_nodes_visited++ > NODE_LIMIT) return False;
}
inline
-static Bool sameIRExprs ( IRExpr** env, IRExpr* e1, IRExpr* e2 )
+static Bool sameIRExprs ( IRExpr** env, const IRExpr* e1, const IRExpr* e2 )
{
Bool same;
--vex-iropt-level > 0, that is, vex_control.iropt_verbosity > 0.
Bad because it duplicates functionality from typeOfIRExpr. See
comment on the single use point below for rationale. */
-static
-Bool debug_only_hack_sameIRExprs_might_assert ( IRExpr* e1, IRExpr* e2 )
+static Bool
+debug_only_hack_sameIRExprs_might_assert ( const IRExpr* e1, const IRExpr* e2 )
{
if (e1->tag != e2->tag) return False;
switch (e1->tag) {
/* Is this literally IRExpr_Const(IRConst_V128(0)) ? */
-static Bool isZeroV128 ( IRExpr* e )
+static Bool isZeroV128 ( const IRExpr* e )
{
return toBool( e->tag == Iex_Const
&& e->Iex.Const.con->tag == Ico_V128
}
/* Is this literally IRExpr_Const(IRConst_V128(1...1)) ? */
-static Bool isOnesV128 ( IRExpr* e )
+static Bool isOnesV128 ( const IRExpr* e )
{
return toBool( e->tag == Iex_Const
&& e->Iex.Const.con->tag == Ico_V128
}
/* Is this literally IRExpr_Const(IRConst_V256(0)) ? */
-static Bool isZeroV256 ( IRExpr* e )
+static Bool isZeroV256 ( const IRExpr* e )
{
return toBool( e->tag == Iex_Const
&& e->Iex.Const.con->tag == Ico_V256
}
/* Is this an integer constant with value 0 ? */
-static Bool isZeroU ( IRExpr* e )
+static Bool isZeroU ( const IRExpr* e )
{
if (e->tag != Iex_Const) return False;
switch (e->Iex.Const.con->tag) {
}
/* Is this an integer constant with value 1---1b ? */
-static Bool isOnesU ( IRExpr* e )
+static Bool isOnesU ( const IRExpr* e )
{
if (e->tag != Iex_Const) return False;
switch (e->Iex.Const.con->tag) {
As a result of this, the stmt may wind up being turned into a no-op.
*/
static IRStmt* subst_and_maybe_fold_Stmt ( Bool doFolding,
- IRExpr** env, IRStmt* st )
+ IRExpr** env, const IRStmt* st )
{
# if 0
vex_printf("\nsubst and maybe fold stmt\n");
set[(Int)tmp] = True;
}
-static void addUses_Expr ( Bool* set, IRExpr* e )
+static void addUses_Expr ( Bool* set, const IRExpr* e )
{
Int i;
switch (e->tag) {
}
}
-static void addUses_Stmt ( Bool* set, IRStmt* st )
+static void addUses_Stmt ( Bool* set, const IRStmt* st )
{
Int i;
IRDirty* d;
/* Is this literally IRExpr_Const(IRConst_U1(False)) ? */
-static Bool isZeroU1 ( IRExpr* e )
+static Bool isZeroU1 ( const IRExpr* e )
{
return toBool( e->tag == Iex_Const
&& e->Iex.Const.con->tag == Ico_U1
}
/* Is this literally IRExpr_Const(IRConst_U1(True)) ? */
-static Bool isOneU1 ( IRExpr* e )
+static Bool isOneU1 ( const IRExpr* e )
{
return toBool( e->tag == Iex_Const
&& e->Iex.Const.con->tag == Ico_U1
static
GSAliasing getAliasingRelation_II (
- IRRegArray* descr1, IRExpr* ix1, Int bias1,
- IRRegArray* descr2, IRExpr* ix2, Int bias2
+ IRRegArray* descr1, const IRExpr* ix1, Int bias1,
+ IRRegArray* descr2, const IRExpr* ix2, Int bias2
)
{
UInt minoff1, maxoff1, minoff2, maxoff2;