[LLVMdev] Fwd: Re: Getting Static Array Content

Ivan Llopard ivanllopard at gmail.com
Thu Sep 27 23:57:09 PDT 2012


Forgot cc'ing the list...

-------- Original Message --------
Subject: 	Re: [LLVMdev] Getting Static Array Content
Date: 	Fri, 28 Sep 2012 08:55:51 +0200
From: 	Ivan Llopard <ivanllopard at gmail.com>
To: 	Ryan Taylor <ryta1203 at gmail.com>



Hi Ryan,

On 28/09/2012 02:07, Ryan Taylor wrote:
> I'm trying to get the values in a static global array. What is the 
> best way to go about doing this?
>
> Once I have the pointer (Ie GlobalVariable *GV = 
> dyn_cast<GlobalVariable>(itr))?

Yes. Take a look at hasInitializer() and getInitializer() methods. The 
latter should give you a ConstantDataArray for arrays of simple types 
(dyn_cast here again to be sure).

Ivan

>
> I basically just want to check for ConstantDataSequential and print 
> out the values.
>
> Thanks.
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu          http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120928/d2811666/attachment.html>


More information about the llvm-dev mailing list