[pypy-svn] r35655 - pypy/dist/pypy/translator/llvm
mwh at codespeak.net
mwh at codespeak.net
Tue Dec 12 21:23:06 CET 2006
Author: mwh
Date: Tue Dec 12 21:23:05 2006
New Revision: 35655
Modified:
pypy/dist/pypy/translator/llvm/funcnode.py
Log:
support a lot more return types for functions with multiple switches
Modified: pypy/dist/pypy/translator/llvm/funcnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/funcnode.py (original)
+++ pypy/dist/pypy/translator/llvm/funcnode.py Tue Dec 12 21:23:05 2006
@@ -96,7 +96,13 @@
codewriter._indent('call void %abort()')
rettype = self.graph.getreturnvar().concretetype
if rettype is lltype.Void:
- codewriter._indent('ret')
+ codewriter._indent('ret void')
+ elif rettype is lltype.Bool:
+ codewriter._indent('ret bool false')
+ elif rettype is lltype.Float:
+ codewriter._indent('ret double 0.0')
+ elif isinstance(rettype, lltype.Ptr):
+ codewriter._indent('ret %s null'%(self.db.repr_type(rettype)))
else:
codewriter._indent('ret %s 0'%(self.db.repr_type(rettype)))
codewriter.closefunc()
More information about the Pypy-commit
mailing list