mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
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:
parent
998a5bcc80
commit
96bb622646
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user