how to get the address of operand

Hi,

I tried to write code transformation pass using LLVM.

But I couldn’t find how to get the address of some operand (i.e. ‘&’ operation in C).

If an integer type variable is generated by AllocaInst(), is there any method to get the address of that variable?

Thanks,

Keoncheol

Keoncheol Shin wrote:

Hi,
I tried to write code transformation pass using LLVM.
But I couldn’t find how to get the address of some operand (i.e. ‘&’ operation in C).
If an integer type variable is generated by AllocaInst(), is there any method to get the address of that variable?
  

The LLVM alloca instruction allocates memory on the stack. The SSA
value that the alloca generates is a pointer to the integer on the stack.

-- John T.

The value returned by the AllocaInst is a pointer to the stack address where the integer will be stored.

–Owen