Following the getting started instruction, I'm trying to get the LLVM
translation pgcd example below.
I'm on Windows XP using LLVM cvs build with VC++ 7.1.
---
>>> t = Translator(test.my_gcd)
a = t.annotate([int, int])
t.specialize()
print t.llvm()
<... really huge amount of LLVM code ...>
f = t.llvmcompile()
f.pypy_my_gcd_wrapper(15, 10)
---
But when executing (with pypy 0.7)
f = t.llvmcompile()
The following error occurs.
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\prg\py\App\pypy-0.7\pypy\translator\translator.py", line 296, in
llvmcompile
return genllvm.genllvm(self, really_compile=really_compile,
standalone=standalone, optimize=opti
mize, exe_name=exe_name)
[...] truncated
File "E:\prg\py\App\pypy-0.7\py\process\cmdexec.py", line 107, in
win32_exec_cmd
raise ExecutionFailed(status, status, cmd, out, err)
py.__.process.cmdexec.ExecutionFailed: ExecutionFailed: 1 llvm-as <
my_gcd_1.ll | opt -verify -lowe
rsetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce
-ipconstprop -deadarge
lim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion
-raise -tailduplica
te -simplifycfg -scalarrepl -instcombine -break-crit-edges -condprop -tailcallelim
-simplifycfg -rea
ssociate -loopsimplify -licm -instcombine -indvars -loop-unroll -instcombine
-load-vn -gcse -sccp -i
nstcombine -break-crit-edges -condprop -dse -mergereturn -adce -simplifycfg
-deadtypeelim -constmerg
e -verify -f -o my_gcd_1.bc
opt: Invalid Top Level Block Length! Type:1, Size:49557 (Vers=0, Pos=8)
With PyPy SVN head, I get a more direct error:
print t.llvm()
[...] truncated
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\prg\py\App\pypy\pypy\translator\translator.py", line 201, in llvm
filename = gen.gen_llvm_source()
File "E:\prg\py\App\pypy\pypy\translator\llvm\genllvm.py", line 179, in
gen_llvm_source
codewriter.append(self.gcpolicy.declarations())
AttributeError: 'NoneType' object has no attribute 'declarations'
Does anyone know what I'm doing wrong ?
On another topic, where do the generated files go ? I tried to find the
files generated by the c and llvm translation but couldn't find them...
Baptiste.
_______________________________________________
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev