mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-28 15:54:00 +00:00
Match an element of the return type if it returns a structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fb5fd5a0bb
commit
bccdcca7d1
@ -1395,8 +1395,18 @@ bool Verifier::PerformTypeCheck(Intrinsic::ID ID, Function *F, const Type *Ty,
|
||||
|
||||
if (VT < 0) {
|
||||
int Match = ~VT;
|
||||
if (Match == 0) {
|
||||
if (Ty != FTy->getReturnType()) {
|
||||
const Type *RetTy = FTy->getReturnType();
|
||||
const StructType *ST = cast<StructType>(RetTy);
|
||||
unsigned NumRets = 1;
|
||||
|
||||
if (ST)
|
||||
NumRets = ST->getNumElements();
|
||||
|
||||
if (Match <= static_cast<int>(NumRets - 1)) {
|
||||
if (ST)
|
||||
RetTy = ST->getElementType(Match);
|
||||
|
||||
if (Ty != RetTy) {
|
||||
CheckFailed("Intrinsic parameter #" + utostr(ArgNo - 1) + " does not "
|
||||
"match return type.", F);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user