[LLVMdev] Getting Static Array Content

Ryan Taylor ryta1203 at gmail.com
Fri Sep 28 10:20:56 PDT 2012


Ivan,

  Yes, I had used these for some other values. Looks like this is a
constant type that I wasn't accounting for.

Thanks.

On Thu, Sep 27, 2012 at 11:55 PM, Ivan Llopard <ivanllopard at gmail.com>wrote:

>  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 listLLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120928/d2b4ac62/attachment.html>


More information about the llvm-dev mailing list