Remove unused labels, variables, and functions. Enable warnings.
Change-Id: Icbe24eaf1ad499f28b68b6a5f05368271a0a7e86
diff --git a/vm/analysis/CodeVerify.c b/vm/analysis/CodeVerify.c
index 91f5414..becce81 100644
--- a/vm/analysis/CodeVerify.c
+++ b/vm/analysis/CodeVerify.c
@@ -114,7 +114,9 @@
/* fwd */
+#ifndef NDEBUG
static void checkMergeTab(void);
+#endif
static bool isInitMethod(const Method* meth);
static RegType getInvocationThis(const RegType* insnRegs,\
const int insnRegCount, const DecodedInstruction* pDecInsn,
@@ -540,10 +542,12 @@
/*
* Is this method a class initializer?
*/
+#if 0
static bool isClassInitMethod(const Method* meth)
{
return (*meth->name == '<' && strcmp(meth->name+1, "clinit>") == 0);
}
+#endif
/*
* Look up a class reference given as a simple string descriptor.
@@ -1338,8 +1342,6 @@
static inline RegType getRegisterType(const RegType* insnRegs,
const int insnRegCount, u4 vsrc, VerifyError* pFailure)
{
- RegType type;
-
if (vsrc >= (u4) insnRegCount) {
*pFailure = VERIFY_ERROR_GENERIC;
return kRegTypeUnknown;
@@ -3105,10 +3107,7 @@
{
bool result = false;
const int insnsSize = dvmGetMethodInsnsSize(meth);
- const u2* insns = meth->insns;
const bool generateRegisterMap = gDvm.generateRegisterMaps;
- int i, offset;
- bool isConditional;
RegisterTable regTable;
memset(®Table, 0, sizeof(regTable));
@@ -3258,11 +3257,10 @@
RegisterTable* regTable, UninitInstanceMap* uninitMap)
{
const int insnsSize = dvmGetMethodInsnsSize(meth);
- const u2* insns = meth->insns;
RegType workRegs[meth->registersSize + kExtraRegs];
bool result = false;
bool debugVerbose = false;
- int insnIdx, startGuess, prevAddr;
+ int insnIdx, startGuess;
/*
* Begin by marking the first instruction as "changed".
@@ -3520,7 +3518,6 @@
const DexFile* pDexFile = meth->clazz->pDvmDex->pDexFile;
RegType entryRegs[meth->registersSize + kExtraRegs];
ClassObject* resClass;
- const char* className;
int branchTarget = 0;
const int insnRegCount = meth->registersSize;
RegType tmpType;
@@ -4062,7 +4059,6 @@
case OP_IF_NE:
{
RegType type1, type2;
- bool tmpResult;
type1 = getRegisterType(workRegs, insnRegCount, decInsn.vA,
&failure);
@@ -4488,7 +4484,6 @@
goto iget_1nr_common;
iget_1nr_common:
{
- ClassObject* fieldClass;
InstField* instField;
RegType objType, fieldType;
@@ -4521,7 +4516,6 @@
case OP_IGET_WIDE_VOLATILE:
{
RegType dstType;
- ClassObject* fieldClass;
InstField* instField;
RegType objType;
@@ -4609,7 +4603,6 @@
iput_1nr_common:
{
RegType srcType, fieldType, objType;
- ClassObject* fieldClass;
InstField* instField;
srcType = getRegisterType(workRegs, insnRegCount, decInsn.vA,
@@ -4665,7 +4658,6 @@
checkWidePair(tmpType, typeHi, &failure);
}
if (VERIFY_OK(failure)) {
- ClassObject* fieldClass;
InstField* instField;
RegType objType;
@@ -5125,7 +5117,6 @@
* do this for all registers that have the same object
* instance in them, not just the "this" register.
*/
- int uidx = regTypeToUninitIndex(thisType);
markRefsAsInitialized(workRegs, insnRegCount, uninitMap,
thisType, &failure);
if (!VERIFY_OK(failure))
@@ -5683,7 +5674,6 @@
*/
if ((nextFlags & kInstrCanThrow) != 0 && dvmInsnIsInTry(insnFlags, insnIdx))
{
- DexFile* pDexFile = meth->clazz->pDvmDex->pDexFile;
const DexCode* pCode = dvmGetMethodCode(meth);
DexCatchIterator iterator;