mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
detect invalid combination of sret and byval
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39971 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6bd7ada32d
commit
969c44481b
@ -377,6 +377,10 @@ void Verifier::visitFunction(Function &F) {
|
||||
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()),
|
||||
|
Loading…
Reference in New Issue
Block a user