On Jan 13, 2008, at 1:54 AM, Duncan Sands wrote:
> Hi Evan, this breaks the Ada build:
>
> Wrong type for attribute byval
> void ([4 x i8]*, i8, i8, i8, i8, [4 x i8]*)*  
> @system__file_io__fopen_mode
>
> Is byval supposed to be able to handle passing arrays by value or only
> structs?  The verifier, via ParamAttr::typeIncompatible, checks that
> byval is only applied to pointers to structs:
>
>  if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
>    if (!isa<StructType>(PTy->getElementType()))
>      // Attributes that only apply to pointers to structs.
>      Incompatible |= ParamAttr::ByVal;
>  } else {

byval makes sense semantically for any pointer to sized type, I think  
it would be reasonable to expand it to allow any of these pointers,  
including the one above.

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to