<html dir=""><head><style id="axi-htmleditor-style" type="text/css">p { margin: 0px; }</style></head><body style="font-size: 10pt; font-family: Arial; background-image: none; background-repeat: repeat; background-attachment: fixed;">​<div><div>Hello all,<br><br></div>I have implemented my code in llvmlite which is partly like the following:<br><br>for stmt in irsb.statements:<br>    if isinstance(stmt, pyvex.IRStmt.IMark):<br>        print "------ IMark(0x%x, %d, %d) ------" % (stmt.addr, stmt.len, stmt.delta)<br>    if isinstance(stmt, pyvex.IRStmt.Put):<br>       #if isinstance(stmt.data, pyvex.IRExpr.Const):<br>       if isinstance(stmt.data, pyvex.IRExpr.RdTmp):<br>           irbuilder.store_reg(ll.<wbr>Constant(ll.IntType(64), stmt.data), ll.IntType(64), stmt.offset )<br>    if isinstance(stmt, pyvex.IRStmt.WrTmp):<br>        expr = stmt.expressions[0]<br>        mehran = stmt.tmp<br>        if isinstance(expr, pyvex.IRExpr.Get):<br>            #mehran, expr.offset, expr.t<br>            irbuilder.store_reg(ll.<wbr>Constant(ll.IntType(64), expr.offset), ll.IntType(64), stmt.data)<br>        elif isinstance(expr, pyvex.IRExpr.Load):<br>            irbuilder.store_reg(ll.<wbr>Constant(ll.IntType(64), stmt.tmp), ll.IntType(64), expr.addr)<br>    elif isinstance(stmt, pyvex.IRStmt.Store):<br>        irbuilder.store_reg(ll.<wbr>Constant(ll.IntType(64), stmt.addr), ll.IntType(64), stmt.data)<br><br><br>int_type = ll.IntType(64);<br>ret = irbuilder.ret(ll.Constant(int_<wbr>type, 1))<br>print(str(module))<br><br>llvm_module = llvm.parse_assembly(str(<wbr>module))<br>tm = llvm.Target.from_default_<wbr>triple().create_target_<wbr>machine()<br><br>with llvm.create_mcjit_compiler(<wbr>llvm_module, tm) as ee:<br>     ee.finalize_object()<br>     cfptr = ee.get_pointer_to_function(<wbr>llvm_module.get_function('<wbr>read_amd64'))<br>     cfunc = CFUNCTYPE(c_void)(cfptr)<br>     res = cfunc(42)<br><br></div>when running it in by python, I get an error like the following:<br><br><div>  File "comp.py", line 100, in <module><br>    llvm_module = llvm.parse_assembly(str(<wbr>module))<br>  File "/usr/local/lib/python2.7/<wbr>dist-packages/llvmlite/<wbr>binding/module.py", line 22, in parse_assembly<br>    raise RuntimeError("LLVM IR parsing error\n{0}".format(errmsg))<br>RuntimeError: LLVM IR parsing error<br><string>:13:6: error: expected value token<br>(i64 t3)<br>     ^<br></div>Does anyone know how can I resolve it?</body></html><pre>
-- 
This email was Anti Virus checked by  Security Gateway.</pre>