aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-27 23:33:55 +0000
committerChris Lattner <sabre@nondot.org>2008-04-27 23:33:55 +0000
commit96bb6226462536dc0fff4b5c0250613300abb9fb (patch)
tree22304f155bc3a12de2be869c44561f3f2c6219c4 /lib
parent998a5bcc80214d4e9651dddd6a2780e7ca900eda (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/InlineAsm.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp
index e49bb6dc8f..d563e9557a 100644
--- a/lib/VMCore/InlineAsm.cpp
+++ b/lib/VMCore/InlineAsm.cpp
@@ -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;