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.
Whereas I also want to detect the i32* %1 on line 11 of IR as a pointer
type. So how can I do this??
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.
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.
isa<PointerType>(instr->getOperand(0)->getType()) will check if a pointer
is being stored.