type of the store operand

Hiya,

I want to know what's the type of the operand (value) along with the
store instruction. For example, the following instruction store the
content in an integer type pointer scevgep99.1 to the address another
integer pointer points to.

*"store i8* %scevgep99.1, i8** %scevgep92.1, align 4"*

It seems there is no APIs in StoreInst can do this.

Is there any way to figure the type of the operand of the store instruction?

Zheng Wang wrote:

Hiya,

I want to know what's the type of the operand (value) along with the
store instruction. For example, the following instruction store the
content in an integer type pointer scevgep99.1 to the address another
integer pointer points to.

*"store i8* %scevgep99.1, i8** %scevgep92.1, align 4"*

It seems there is no APIs in StoreInst can do this.

Is there any way to figure the type of the operand of the store instruction?
  
You can do this by first using getOperand() to get the operand of the store instruction which interests you and then calling getType() on the resulting Value * to get the type of the value being stored.

It'll look something like this if SI is a pointer to a StoreInst object and i is the index of the operand being stored to memory:

SI->getOperand(i)->getType();

-- John T.

Hi John,

Thanks. In this case, if I call getType(), it will return a pointer
type. So, how do I know whether this is an pointer points to an
integer address?