C++'ification of Quick compiler's casts
o Eliminate old useless LIR casts.
o Replace remaining C-style casts with new C++ versions.
o Unified instruction encoding enum
o Expand usage of the auto-generated ostream helpers for enum LOG messages.
o Replaced all usages of intptr_t with uintptr_t.
o Fixed bug in removeRedundantBranches, and moved to common code
Change-Id: I53211c0de1be913f958c8fde915296ac08345b7e
diff --git a/src/compiler/codegen/arm/utility_arm.cc b/src/compiler/codegen/arm/utility_arm.cc
index 9069826..1873c2a 100644
--- a/src/compiler/codegen/arm/utility_arm.cc
+++ b/src/compiler/codegen/arm/utility_arm.cc
@@ -54,8 +54,8 @@
LIR* loadPcRel = rawLIR(cUnit, cUnit->currentDalvikOffset, kThumb2Vldrs,
rDest, r15pc, 0, 0, 0, dataTarget);
setMemRefType(loadPcRel, true, kLiteral);
- loadPcRel->aliasInfo = (intptr_t)dataTarget;
- oatAppendLIR(cUnit, (LIR* ) loadPcRel);
+ loadPcRel->aliasInfo = reinterpret_cast<uintptr_t>(dataTarget);
+ oatAppendLIR(cUnit, loadPcRel);
return loadPcRel;
}
@@ -157,9 +157,9 @@
LIR* loadPcRel = rawLIR(cUnit, cUnit->currentDalvikOffset,
kThumb2LdrPcRel12, rDest, 0, 0, 0, 0, dataTarget);
setMemRefType(loadPcRel, true, kLiteral);
- loadPcRel->aliasInfo = (intptr_t)dataTarget;
+ loadPcRel->aliasInfo = reinterpret_cast<uintptr_t>(dataTarget);
res = loadPcRel;
- oatAppendLIR(cUnit, (LIR* ) loadPcRel);
+ oatAppendLIR(cUnit, loadPcRel);
/*
* To save space in the constant pool, we use the ADD_RRI8 instruction to
@@ -193,7 +193,7 @@
opcode = kThumbBlxR;
break;
default:
- LOG(FATAL) << "Bad opcode " << (int)op;
+ LOG(FATAL) << "Bad opcode " << op;
}
return newLIR1(cUnit, opcode, rDestSrc);
}
@@ -295,7 +295,7 @@
DCHECK_EQ(shift, 0);
return newLIR4(cUnit, kThumb2Ubfx, rDestSrc1, rSrc2, 0, 16);
default:
- LOG(FATAL) << "Bad opcode: " << (int)op;
+ LOG(FATAL) << "Bad opcode: " << op;
break;
}
DCHECK_GE(static_cast<int>(opcode), 0);
@@ -374,7 +374,7 @@
opcode = kThumb2RorRRR;
break;
default:
- LOG(FATAL) << "Bad opcode: " << (int)op;
+ LOG(FATAL) << "Bad opcode: " << op;
break;
}
DCHECK_GE(static_cast<int>(opcode), 0);
@@ -496,7 +496,7 @@
return res;
}
default:
- LOG(FATAL) << "Bad opcode: " << (int)op;
+ LOG(FATAL) << "Bad opcode: " << op;
}
if (modImm >= 0) {
@@ -611,8 +611,8 @@
rawLIR(cUnit, cUnit->currentDalvikOffset, kThumb2Vldrd,
s2d(rDestLo, rDestHi), r15pc, 0, 0, 0, dataTarget);
setMemRefType(loadPcRel, true, kLiteral);
- loadPcRel->aliasInfo = (intptr_t)dataTarget;
- oatAppendLIR(cUnit, (LIR* ) loadPcRel);
+ loadPcRel->aliasInfo = reinterpret_cast<uintptr_t>(dataTarget);
+ oatAppendLIR(cUnit, loadPcRel);
res = loadPcRel;
}
} else {
@@ -681,7 +681,7 @@
opcode = (thumbForm) ? kThumbLdrsbRRR : kThumb2LdrsbRRR;
break;
default:
- LOG(FATAL) << "Bad size: " << (int)size;
+ LOG(FATAL) << "Bad size: " << size;
}
if (thumbForm)
load = newLIR3(cUnit, opcode, rDest, rBase, rIndex);
@@ -742,7 +742,7 @@
opcode = (thumbForm) ? kThumbStrbRRR : kThumb2StrbRRR;
break;
default:
- LOG(FATAL) << "Bad size: " << (int)size;
+ LOG(FATAL) << "Bad size: " << size;
}
if (thumbForm)
store = newLIR3(cUnit, opcode, rSrc, rBase, rIndex);
@@ -854,7 +854,7 @@
}
break;
default:
- LOG(FATAL) << "Bad size: " << (int)size;
+ LOG(FATAL) << "Bad size: " << size;
}
if (shortForm) {
@@ -961,7 +961,7 @@
}
break;
default:
- LOG(FATAL) << "Bad size: " << (int)size;
+ LOG(FATAL) << "Bad size: " << size;
}
if (shortForm) {
store = res = newLIR3(cUnit, opcode, rSrc, rBase, encodedDisp);