In my xmlvm generated Objective C code (from Java source), XCode spews out plenty of warnings like this:
warning: unused variable "_op3".
Can the xmlvm team look into fixing it since good code should be warning free?
Here is an example method (generated by xmlvm):
- (void) addScore___int :(int)n1
{
XMLVMElem _stack[3];
XMLVMElem _locals[2];
int _sp = 0;
XMLVMElem _op1, _op2, _op3;
NSAutoreleasePool* _pool = [[NSAutoreleasePool alloc] init];
_locals[0].o = self;
_locals[1].i = n1;
label0:;
_stack[_sp++].o = _locals[0].o;
_op1 = _stack[_sp - 1];
_stack[_sp++] = _op1;
_op1.o = _stack[--_sp].o;
_op2.i = ((com_applimobile_rotomem_model_GameSession*) _op1.o)->score;
_stack[_sp++].i = _op2.i;
_op1.i = _locals[1].i;
_stack[_sp++].i = _op1.i;
_op2.i = _stack[--_sp].i;
_op1.i = _stack[--_sp].i;
_stack[_sp++].i = _op1.i + _op2.i; _op1.i = _stack[--_sp].i;
_op2.o = _stack[--_sp].o;
((com_applimobile_rotomem_model_GameSession*) _op2.o)->score = _op1.i;
_stack[_sp++].o = _locals[0].o;
_stack[_sp++].o = _locals[0].o;
_op1.o = _stack[--_sp].o;
_op2.i = ((com_applimobile_rotomem_model_GameSession*) _op1.o)->score;
_stack[_sp++].i = _op2.i;
_stack[_sp++].o = _locals[0].o;
_op1.o = _stack[--_sp].o;
_op2.i = ((com_applimobile_rotomem_model_GameSession*) _op1.o)->topScore;
_stack[_sp++].i = _op2.i;
_sp -= 2;
_op1.i = [java_lang_Math max___int_int:_stack[_sp + 0].i:_stack[_sp + 1].i];
_stack[_sp++].i = _op1.i;
_op1.i = _stack[--_sp].i;
_op2.o = _stack[--_sp].o;
((com_applimobile_rotomem_model_GameSession*) _op2.o)->topScore = _op1.i;
label1:;
[_pool release];
return;
}
Sometimes methods have spurious _op2 as well. Ideally, you should be able to figure out what variables are needed, and only output those.