How to keep array type info in arguments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to keep array type info in arguments

Yiping Fan
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?



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to keep array type info in arguments

Chris Lattner
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/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev