For some background, I am implementing a compiler using the llvmpy library which is a wrapper around the LLVM IR generation.
I have created a character type which represents one or more UTF-8 code points. These code points are stored in an array so a character can be one of the following arrays:
[1 x i32], [2 x i32], ..., [6 x i32]
Now, I would like to implement a string type. This would be an array of pointers to arrays:
[n x [1-6 x i32]*] where n is the string length
However, (as far as I know) it seems that LLVM requires me to declare the length of the inner array. So, while I can store this:
[[1 x i32], [1 x i32], [1 x i32]]
I cannot store this:
[[1 x i32], [2 x i32]]
Is there a way to store an array of array pointers if the array pointers lead to arrays of different length?