if (const ParamAttrsList *Attrs = FT->getParamAttrs()) {
unsigned Idx = 1;
- Assert(!Attrs->paramHasAttr(0, ParamAttr::ByVal),
- "Attribute ByVal should not apply to functions!");
+ Assert1(!Attrs->paramHasAttr(0, ParamAttr::ByVal),
+ "Attribute ByVal should not apply to functions!", &F);
+ Assert1(!Attrs->paramHasAttr(0, ParamAttr::StructRet),
+ "Attribute SRet should not apply to functions!", &F);
+ Assert1(!Attrs->paramHasAttr(0, ParamAttr::InReg),
+ "Attribute InReg should not apply to functions!", &F);
for (FunctionType::param_iterator I = FT->param_begin(),
E = FT->param_end(); I != E; ++I, ++Idx) {
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()),
"Attribute ByVal should only apply to pointer to structs!", &F);
}
+
+ Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoReturn),
+ "Attribute NoReturn should only be applied to function", &F);
+ Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoUnwind),
+ "Attribute NoUnwind should only be applied to function", &F);
}
}
break;
}
} else if (TypeID == Type::VectorTyID) {
- // If this is a packed argument, verify the number and type of elements.
+ // If this is a vector argument, verify the number and type of elements.
const VectorType *PTy = cast<VectorType>(Ty);
int ElemTy = va_arg(VA, int);
if (ElemTy != PTy->getElementType()->getTypeID()) {