summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2011-11-26 22:23:57 +0000
committerPeter Wu <lekensteyn@gmail.com>2011-11-26 22:23:57 +0000
commit6f5cdb9f833238f9bea7c403d7e0c068350a4a20 (patch)
treeeac8769c5fc36d36b8ef1b46b8dbfb309d4406b7
parent9e3a7563ccfde741187b4163bfde63f9c87b6122 (diff)
downloadpp2cc-6f5cdb9f833238f9bea7c403d7e0c068350a4a20.tar.gz
Disable label addition for if and then lines
-rwxr-xr-xpp2cc.py20
1 files 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))