[cfe-dev] Returning vectors by value

Chris Lattner clattner at apple.com
Thu Feb 18 09:54:10 PST 2010


On Feb 18, 2010, at 3:58 AM, Robert Quill wrote:

> Hi all,
> 
> We would like to be able to add support to CLang for returning vectors
> by value so you could do something like:
> 
> int2 my_func(int x)
> {
>   return (int2)(x,x);
> }
> 
> main()
> {
>   printf("%d", my_func(5).x);
> }
> 
> Obviously this is a completely pointless example but it demonstrates
> what we would like to be able to do. At the moment we hit an assert in
> EmitCallExprLValue: "Can't have a scalar return unless the return type
> is a reference type!"

this is just a missing case in the code generator, please file a bugzilla.

-Chris

> 
> I was wondering if anyone had any advice about the right way to go about
> solving this?
> 
> Thanks for your help,
> 
> Rob
> -
> This message is subject to Imagination Technologies' e-mail terms: http://www.imgtec.com/e-mail.htm
> 
> Imagination Technologies Ltd is a limited company registered in England No:  1306335 
> Registered Office: Imagination House, Home Park Estate, Kings Langley, Hertfordshire, WD4 8LZ.  
> 
> Email to and from the company may be monitored for compliance and other administrative purposes.  
> -
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list