[pypy-svn] r40732 - pypy/dist/pypy/translator/llvm
mwh at codespeak.net
mwh at codespeak.net
Sun Mar 18 22:53:23 CET 2007
Author: mwh
Date: Sun Mar 18 22:53:21 2007
New Revision: 40732
Modified:
pypy/dist/pypy/translator/llvm/funcnode.py
Log:
fix all the LLVM tests that failed since the merge of the
jit-virtual-world branch -- the changes to the
exceptiontransformer meant genllvm's assumptions about exitcase
ordering were no longer true.
ps: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargh
Modified: pypy/dist/pypy/translator/llvm/funcnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/funcnode.py (original)
+++ pypy/dist/pypy/translator/llvm/funcnode.py Sun Mar 18 22:53:21 2007
@@ -158,9 +158,18 @@
cond, condtype = self.db.repr_argwithtype(block.exitswitch)
if block.exitswitch.concretetype == lltype.Bool:
assert len(block.exits) == 2
+ if block.exits[0].llexitcase == False:
+ assert block.exits[1].llexitcase == True
+ false_case = block.exits[0].target
+ true_case = block.exits[1].target
+ else:
+ assert block.exits[0].llexitcase == True
+ assert block.exits[1].llexitcase == False
+ false_case = block.exits[1].target
+ true_case = block.exits[0].target
codewriter.br(cond,
- self.block_to_name[block.exits[0].target],
- self.block_to_name[block.exits[1].target])
+ self.block_to_name[false_case],
+ self.block_to_name[true_case])
elif block.exitswitch.concretetype in \
(lltype.Signed, lltype.Unsigned, lltype.SignedLongLong,
More information about the Pypy-commit
mailing list