[llvm-commits] [llvm] r50328 - /llvm/trunk/lib/VMCore/InlineAsm.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 27 16:33:55 PDT 2008
Author: lattner
Date: Sun Apr 27 18:33:55 2008
New Revision: 50328
URL: http://llvm.org/viewvc/llvm-project?rev=50328&view=rev
Log:
Allow asms to return multiple results by value.
Modified:
llvm/trunk/lib/VMCore/InlineAsm.cpp
Modified: llvm/trunk/lib/VMCore/InlineAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/InlineAsm.cpp?rev=50328&r1=50327&r2=50328&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/InlineAsm.cpp (original)
+++ llvm/trunk/lib/VMCore/InlineAsm.cpp Sun Apr 27 18:33:55 2008
@@ -202,11 +202,20 @@
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;
More information about the llvm-commits
mailing list