From 6f5cdb9f833238f9bea7c403d7e0c068350a4a20 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 26 Nov 2011 22:23:57 +0000 Subject: Disable label addition for if and then lines --- pp2cc.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pp2cc.py b/pp2cc.py index 1b5e1c5..30dc5e0 100755 --- a/pp2cc.py +++ b/pp2cc.py @@ -592,8 +592,8 @@ class Parse(object): def parseIf(self, linked_node): linked_node.incrementLevel() node = linked_node.node - lbl_if = self.uniqLbl("if") # if - lbl_th = self.uniqLbl("th") # then + #lbl_if = self.uniqLbl("if") # if + #lbl_th = self.uniqLbl("th") # then if node.iffalse: lbl_end = lbl_el = self.uniqLbl("el") # else else: @@ -602,9 +602,9 @@ class Parse(object): lines = self.parseStatement(node.cond, linked_node) # unused label, but insert it for clearness if possible - if len(lines) > 0: - if not self.asm.has_label(lines[0]): - lines[0] = self.asm.insert_label(lines[0], lbl_if) + #if len(lines) > 0: + # if not self.asm.has_label(lines[0]): + # lines[0] = self.asm.insert_label(lines[0], lbl_if) # if cond is zero, go to else (BEQ branches if Z=0). Do not use CMP lines.append(self.asm.branch_op("BEQ", lbl_end)) @@ -612,11 +612,11 @@ class Parse(object): # if true... then_block = self.parseStatement(node.iftrue, linked_node) # required label, so insert a NOOP if necessary - if len(then_block) > 0: - if self.asm.has_label(then_block[0]): - lines.append(self.asm.noop(lbl_th)) - else: - then_block[0] = self.asm.insert_label(then_block, lbl_th) + #if len(then_block) > 0: + # if self.asm.has_label(then_block[0]): + # lines.append(self.asm.noop(lbl_th)) + # else: + # then_block[0] = self.asm.insert_label(then_block, lbl_th) lines += then_block lines.append(self.asm.branch_op("BRA", lbl_end)) -- cgit v1.2.1