[LLVMdev] How to retrieve IntToPtr from StoreInst?

Tim Northover t.p.northover at gmail.com
Fri Apr 19 01:57:16 PDT 2013


Hi,

> According to http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html, this
> class only provides method such as getWithOperands(), but this method doesnt
> seem to do what I want.

At the top is DECLARE_TRANSPARENT_OPERAND_ACCESSORS, which means you
can call "getOperand(OpNum)" and so on to access the actual operands.
Presumably in your simple case the first operand will be (castable to)
an instance of ConstantInt, which you can call "getZExtValue" on. With
appropriate checks, obviously.

Tim.



More information about the llvm-dev mailing list