[llvm-commits] [llvm] r39971 - /llvm/trunk/lib/VMCore/Verifier.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Jul 17 06:34:23 PDT 2007
Author: rafael
Date: Tue Jul 17 08:34:23 2007
New Revision: 39971
URL: http://llvm.org/viewvc/llvm-project?rev=39971&view=rev
Log:
detect invalid combination of sret and byval
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=39971&r1=39970&r2=39971&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Jul 17 08:34:23 2007
@@ -377,6 +377,10 @@
if (Attrs->paramHasAttr(Idx, ParamAttr::ByVal)) {
Assert1(isa<PointerType>(FT->getParamType(Idx-1)),
"Attribute ByVal should only apply to pointer to structs!", &F);
+
+ Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::StructRet),
+ "Attributes ByVal and StructRet are incompatible!", &F);
+
const PointerType *Ty =
cast<PointerType>(FT->getParamType(Idx-1));
Assert1(isa<StructType>(Ty->getElementType()),
More information about the llvm-commits
mailing list