[LLVMdev] Array Slicing?

Andrew Lenharth andrewl at lenharth.org
Wed Oct 3 13:52:59 PDT 2007


On 10/3/07, Jon Sargeant <delta17 at cox.net> wrote:
> I'm designing a language that supports array slicing.  Does LLVM allows
> conversions between array pointers?  For example, can I cast a
> pointer-to-array-of-5-ints to a pointer-to-array-of-3-ints?  Can I get
> the address of the third element of an array-of-5-ints and convert it to
> a pointer-to-array-of-3-ints?  Then again, I suppose a pointer-to-int
> would work just as well since LLVM supports pointer arithmetic.

Arbitrary casts are supported.  You can cast pointers around all you like.

Andrew



More information about the llvm-dev mailing list