Commit c34a692b authored by zygzagZ's avatar zygzagZ

cleanup

parent 46d82364
...@@ -116,12 +116,10 @@ void QuadrupleGenerator::visitELitInt(ELitInt *p) { ...@@ -116,12 +116,10 @@ void QuadrupleGenerator::visitELitInt(ELitInt *p) {
void QuadrupleGenerator::visitELitTrue(ELitTrue *p) { void QuadrupleGenerator::visitELitTrue(ELitTrue *p) {
lastVar = alloc(1); lastVar = alloc(1);
// if (labelTrue) addQuad<QJump>(labelTrue);
} }
void QuadrupleGenerator::visitELitFalse(ELitFalse *p) { void QuadrupleGenerator::visitELitFalse(ELitFalse *p) {
lastVar = alloc(0); lastVar = alloc(0);
// if (labelFalse) addQuad<QJump>(labelFalse);
} }
void QuadrupleGenerator::visitEString(EString *p) { void QuadrupleGenerator::visitEString(EString *p) {
......
...@@ -101,8 +101,6 @@ private: ...@@ -101,8 +101,6 @@ private:
void addLastVarCondJump(const VariablePtr& l, Quadruple::Op op, const VariablePtr& r) { void addLastVarCondJump(const VariablePtr& l, Quadruple::Op op, const VariablePtr& r) {
if (labelTrue && labelFalse) { if (labelTrue && labelFalse) {
addQuad<QJumpCond>(labelTrue, l, op, r); addQuad<QJumpCond>(labelTrue, l, op, r);
// testy jump assign
// addQuad<QAssign>(lastVar, l, op, r);
addQuad<QJump>(labelFalse); addQuad<QJump>(labelFalse);
return; return;
} else if (labelTrue) { } else if (labelTrue) {
...@@ -111,9 +109,6 @@ private: ...@@ -111,9 +109,6 @@ private:
} else if (labelFalse) { } else if (labelFalse) {
addQuad<QJumpCond>(labelFalse, l, op.neg(), r); addQuad<QJumpCond>(labelFalse, l, op.neg(), r);
lastVar = alloc(1); lastVar = alloc(1);
} else {
// testy jump assign
// return;
} }
addQuad<QAssign>(lastVar, l, op, r); addQuad<QAssign>(lastVar, l, op, r);
} }
......
...@@ -9,7 +9,7 @@ void RegisterAllocator::analyseLive() { ...@@ -9,7 +9,7 @@ void RegisterAllocator::analyseLive() {
for (const auto& q : v->writes) { for (const auto& q : v->writes) {
q->block->flow.addDef(v); q->block->flow.addDef(v);
} }
if (/*!v->info ||*/ v->constExpr) continue; if (v->constExpr) continue;
for (const auto& q : v->uses) { for (const auto& q : v->uses) {
q->block->flow.addUse(v); q->block->flow.addUse(v);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment