please dont break
This commit is contained in:
@ -535,11 +535,39 @@ int generateCondGoto(Instruction *inst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int generateIfTrue(Instruction *inst) {
|
int generateIfTrue(Instruction *inst) {
|
||||||
return -1;
|
TNodeOrConst *op1 = getOperand1(inst);
|
||||||
|
|
||||||
|
if (op1 == NULL) {
|
||||||
|
printdebug("%sgenerateIfTrue failed, NULL operand", COLOR_RED);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGNode *cg = findCG(getTN(op1));
|
||||||
|
if (cg == NULL) {
|
||||||
|
printdebug("generateIfTrue failed, operand not on stack");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(cg_flag, "\tcmpl\t$0, %d(%%rbp)\t#if true start\n", getAddress(cg));
|
||||||
|
fprintf(cg_flag, "\tjne\t.L%d\t\t#if true end\n", getLabel(inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
int generateIfFalse(Instruction *inst) {
|
int generateIfFalse(Instruction *inst) {
|
||||||
return -1;
|
TNodeOrConst *op1 = getOperand1(inst);
|
||||||
|
|
||||||
|
if (op1 == NULL) {
|
||||||
|
printdebug("%sgenerateIfFalse failed, NULL operand", COLOR_RED);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGNode *cg = findCG(getTN(op1));
|
||||||
|
if (cg == NULL) {
|
||||||
|
printdebug("generateIfFalse failed, operand not on stack");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(cg_flag, "\tcmpl\t$0, %d(%%rbp)\t#if false start\n", getAddress(cg));
|
||||||
|
fprintf(cg_flag, "\tje\t.L%d\t\t#if false end\n", getLabel(inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
int generateLessThan(Instruction *inst) {
|
int generateLessThan(Instruction *inst) {
|
||||||
|
@ -12,9 +12,10 @@ Fib(i) := {
|
|||||||
} else {
|
} else {
|
||||||
i := i;
|
i := i;
|
||||||
}
|
}
|
||||||
b := b | (a & c);
|
(*b := b | (a & c);
|
||||||
b := 2 < 3;
|
b := 2 < 3;*)
|
||||||
if(i = 1) then {
|
if(i = 1) then {
|
||||||
|
i := printCharacter('a');
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return i + Fib(i - 1);
|
return i + Fib(i - 1);
|
||||||
|
Reference in New Issue
Block a user