[LLVMdev] obtain the address and size of LLVM generated temporaries

Duncan Sands baldrick at free.fr
Wed Feb 23 00:07:01 PST 2011


Hi Chuck,

> I wonder what is the right approach to obtain the address and size of
> LLVM (compiler) generated temporaries?
>
> E.g.
>
> %0 = %x + %y
> store i32 i0, i32 %z, align 4
>
> How can I get the address of %0 (which could be either a stack or heap
> variable)?

actually %0 is neither a stack or a heap variable, it is an LLVM "virtual
register" and has no address.  It has type i32, so storing it writes the
same number of bytes as any i32 store, see getTypeStoreSize.

Ciao, Duncan.



More information about the llvm-dev mailing list