Question

​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?