[llvm-commits] [llvm] r47848 - in /llvm/trunk/lib/VMCore: Function.cpp Verifier.cpp
Devang Patel
dpatel at apple.com
Mon Mar 3 10:58:16 PST 2008
Author: dpatel
Date: Mon Mar 3 12:58:16 2008
New Revision: 47848
URL: http://llvm.org/viewvc/llvm-project?rev=47848&view=rev
Log:
If a function uses multive values in ret instruction then it
is returning a struct value.
Modified:
llvm/trunk/lib/VMCore/Function.cpp
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=47848&r1=47847&r2=47848&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Mon Mar 3 12:58:16 2008
@@ -170,7 +170,8 @@
/// @brief Determine if the function returns a structure.
bool Function::isStructReturn() const {
- return paramHasAttr(1, ParamAttr::StructRet);
+ return paramHasAttr(1, ParamAttr::StructRet)
+ || isa<StructType>(getReturnType());
}
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=47848&r1=47847&r2=47848&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Mar 3 12:58:16 2008
@@ -455,9 +455,6 @@
isa<StructType>(F.getReturnType()),
"Functions cannot return aggregate values!", &F);
- Assert1(!F.isStructReturn() || FT->getReturnType() == Type::VoidTy,
- "Invalid struct-return function!", &F);
-
const ParamAttrsList *Attrs = F.getParamAttrs();
Assert1(!Attrs ||
More information about the llvm-commits
mailing list