[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable

Tim Northover t.p.northover at gmail.com
Sun Sep 1 12:01:11 PDT 2013


Hi,

On 1 September 2013 15:47, Abhinash Jain <omnia at mailinator.com> wrote:
> Sorry I have actually edited the post.

This is primarily an e-mail list; the vast majority of us won't see
any edits (on some web mirror?).

> I did check its type by using
> isa<PointerType>(cast<AllocaInst>(instr->getOperand(1))->getAllocatedType())
> but it is only detecting  i32** %b on line 8 of IR as a pointer type.

Not all pointers will come (directly or indirectly) from an
AllocaInst. You might just want
isa<PointerType>(instr->getOperand(1)->getType()), though of course
that'll be true for any memory operand of a store instruction.

Tim.



More information about the llvm-dev mailing list