[LLVMdev] How to keep array type info in arguments

Chris Lattner sabre at nondot.org
Thu Dec 22 19:12:28 PST 2005


On Thu, 22 Dec 2005, Yiping Fan wrote:
> When I tried LLVM for a function with an array as an argument, the type
> infomation of the array seems lost. For example, for this function,
>
> void DCT(short data[64], char step, char offset),
>
> its corresponding LLVM code will be
>
> void %DCT8_int(short* %data, sbyte %step, sbyte %offset) ,
>
> and every access of "data" will be a pointer access, instead of an array
> access.
>
> Is there any way to retrieve the array type infomation back in LLVM?

Nope, sorry.  This behavior is mandated by C.  If you can hack the code, 
you should be able to use :

void DCT(short data[1][64], char step, char offset),

which will give you the info you want.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list