[llvm-dev] Question

Samaneh Berenjian via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 9 16:02:06 PDT 2017


​I am using llvmlite for my project in combination with Pyvex. I have defined some functions in llvmlite like the following:
def put64(putoffset, val):
   llvmtmp = builder.gep(regtag, (int32(0), int32(putoffset)), True)
   return builder.store(val, llvmtmp)

However, when I want to call this function using the following code:
for stmt in irsb.statements:
   if isinstance(stmt, pyvex.IRStmt.Put):
      putoffset = stmt.offset
      put64("t3", putoffset)

I encounter the error: AttributeError: 'int' object has no attribute 'type'.  Calling call put64(putoffset,"t3") instead, I encounter the error:   

AttributeError: 'str' object has no attribute 'type'. My python version is 2.7.9.Thefunction for int32 value is :def int32(val):     return ir.Constant(ir.IntType(32), val)
                    
Does anyone know how can I resolve this problem?


-- 
This email was Anti Virus checked by  Security Gateway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170710/02eb826b/attachment.html>


More information about the llvm-dev mailing list