[LLVMdev] How to recognize global & local variable?

Soumya_Prasad_Ukil ukil.soumya at gmail.com
Wed Jul 21 05:27:19 PDT 2010


Yeah that's true. But I want somewhat different. Through Instruction how do
u know that? If an instruction like %a = alloca i32 is there, how to get the
variable 'a' ? Then on that variable we can check as you have said Right?
How to capture that variable ?

On 21 July 2010 16:07, Duncan Sands <baldrick at free.fr> wrote:

> Hi Soumya_Prasad_Ukil,
>
> > Can you guys tell how to recognize local & global variables ? Is there
> > any macro on Value* defined in LLVM?
>
> Global variable: isa<GlobalVariable>(V)
> Local variable: isa<AllocaInst>(V)
>
> Ciao,
>
> Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
regards,
soumya prasad ukil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100721/41d11ab6/attachment.html>


More information about the llvm-dev mailing list