[LLVMdev] Quick doubt about IR

Mingliang LIU liuml07 at gmail.com
Thu Dec 5 00:46:36 PST 2013


Hi,

I wonder why the type of %arr is i8, instead of i32 in your code?

Thanks,
Mingliang


On Thu, Dec 5, 2013 at 5:40 AM, Shivam Bhagi <shivam.bhagi at outlook.com>wrote:

> Hi,
>
> While looking over the IR generated by my source code, I came across the
> following:
>
> %arr = alloca [30 x i8], align 1
>
> In the source code this particular line of code is represented by:
>
> int arr[30];
>
> I was wondering how I could change the capacity of arr from 30 to any
> other integral value via a function-pass. I know that 'alloca' can be used
> for reserving space on stack; further, 'store' can be used for writing to
> memory. I was wondering how that would work for an array though?
>
> Thanks,
> Shivam
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Tsinghua University
Email: liuml07 at mails.tsinghua.edu.cn
Homepage: http://pacman.cs.tsinghua.edu.cn/~liuml07/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131205/b4fa6a69/attachment.html>


More information about the llvm-dev mailing list