mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Match an element of the return type if it returns a structure.
llvm-svn: 59576
This commit is contained in:
parent
dd2491943e
commit
5a374e2969
@ -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…
Reference in New Issue
Block a user