Permalink
Browse files

drop optimization in Ifstatement.emit from stage 1

  • Loading branch information...
1 parent c1241c1 commit d3fa0b73538a72fa121c608be383c6949c2b59a3 @NotFound committed May 28, 2012
Showing with 5 additions and 13 deletions.
  1. +5 −13 winxedst1.winxed
View
18 winxedst1.winxed
@@ -6746,22 +6746,14 @@ class IfStatement : ConditionalStatement
{
var truebranch = self.truebranch;
var falsebranch = self.falsebranch;
- int t_empty = truebranch.isempty();
- int f_empty = falsebranch.isempty();
- string elselabel = "";
- if (! f_empty)
- elselabel = self.genlabel();
+ string elselabel = self.genlabel();
string endlabel = self.genlabel();
- string cond_false = f_empty ? endlabel : elselabel;
self.annotate(e);
- self.emit_else(e, cond_false);
+ self.emit_else(e, elselabel);
truebranch.emit(e);
-
- if (! f_empty) {
- e.emitgoto(endlabel);
- e.emitlabel(elselabel, "else");
- falsebranch.emit(e);
- }
+ e.emitgoto(endlabel);
+ e.emitlabel(elselabel, "else");
+ falsebranch.emit(e);
e.emitlabel(endlabel, "endif");
}
}

0 comments on commit d3fa0b7

Please sign in to comment.