aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Function.cpp3
-rw-r--r--lib/VMCore/Verifier.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index d9133588d8..92737f66d9 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -170,7 +170,8 @@ bool Function::onlyReadsMemory() const {
/// @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());
}
//===----------------------------------------------------------------------===//
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 575bb82df7..3d6832475f 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -455,9 +455,6 @@ void Verifier::visitFunction(Function &F) {
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 ||