Allow asms to return multiple results by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-04-27 23:33:55 +00:00
parent 998a5bcc80
commit 96bb622646

View File

@ -202,11 +202,20 @@ bool InlineAsm::Verify(const FunctionType *Ty, const std::string &ConstStr) {
break;
}
}
if (NumOutputs > 1) return false; // Only one result allowed so far.
if ((Ty->getReturnType() != Type::VoidTy) != NumOutputs)
return false; // NumOutputs = 1 iff has a result type.
switch (NumOutputs) {
case 0:
if (Ty->getReturnType() != Type::VoidTy) return false;
break;
case 1:
if (isa<StructType>(Ty->getReturnType())) return false;
break;
default:
const StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
if (STy == 0 || STy->getNumElements() != NumOutputs)
return false;
break;
}
if (Ty->getNumParams() != NumInputs) return false;
return true;