[llvm-commits] [llvm] r46207 - /llvm/trunk/lib/VMCore/ParameterAttributes.cpp

Duncan Sands baldrick at free.fr
Mon Jan 21 03:28:49 PST 2008


Author: baldrick
Date: Mon Jan 21 05:28:49 2008
New Revision: 46207

URL: http://llvm.org/viewvc/llvm-project?rev=46207&view=rev
Log:
Check that sret is only used on pointers to types
with a size, like byval.

Modified:
    llvm/trunk/lib/VMCore/ParameterAttributes.cpp

Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=46207&r1=46206&r2=46207&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original)
+++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Mon Jan 21 05:28:49 2008
@@ -202,8 +202,8 @@
 
   if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
     if (!PTy->getElementType()->isSized())
-      // The byval attribute only applies to pointers to types with a size.
-      Incompatible |= ParamAttr::ByVal;
+      // The byval and sret attributes only apply to pointers to sized types.
+      Incompatible |= ByVal | StructRet;
   } else {
     // Attributes that only apply to pointers.
     Incompatible |= ByVal | Nest | NoAlias | StructRet;





More information about the llvm-commits mailing list