diff --git a/docs/LangRef.html b/docs/LangRef.html
index 935625dbfaa..6f5fbb3f35b 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -1592,7 +1592,7 @@ Classifications
Syntax:
- <returntype list> (<parameter list>)
+ <returntype> (<parameter list>)
...where '<parameter list>' is a comma-separated list of type
@@ -1600,8 +1600,8 @@ Classifications
which indicates that the function takes a variable number of arguments.
Variable argument functions can access their arguments with
the variable argument handling intrinsic
- functions. '<returntype list>' is a comma-separated list of
- first class type specifiers.
+ functions. '<returntype>' is a any type except
+ label and metadata.
Examples:
@@ -1626,8 +1626,8 @@ Classifications
{i32, i32} (i32) |
- A function taking an i32, returning two
- i32 values as an aggregate of type { i32, i32 }
+ | A function taking an i32, returning a
+ structure containing two i32 values
|
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 0883cc304b1..da53800ad7e 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -365,25 +365,11 @@ const IntegerType *Type::getInt64Ty(LLVMContext &C) {
/// isValidReturnType - Return true if the specified type is valid as a return
/// type.
bool FunctionType::isValidReturnType(const Type *RetTy) {
- if (RetTy->isFirstClassType()) {
- if (const PointerType *PTy = dyn_cast(RetTy))
- return PTy->getElementType()->getTypeID() != MetadataTyID;
- return true;
- }
- if (RetTy->getTypeID() == VoidTyID || RetTy->getTypeID() == MetadataTyID ||
- isa(RetTy))
- return true;
-
- // If this is a multiple return case, verify that each return is a first class
- // value and that there is at least one value.
- const StructType *SRetTy = dyn_cast(RetTy);
- if (SRetTy == 0 || SRetTy->getNumElements() == 0)
- return false;
-
- for (unsigned i = 0, e = SRetTy->getNumElements(); i != e; ++i)
- if (!SRetTy->getElementType(i)->isFirstClassType())
- return false;
- return true;
+ if (const PointerType *PTy = dyn_cast(RetTy))
+ return PTy->getElementType()->getTypeID() != MetadataTyID;
+
+ return RetTy->getTypeID() != LabelTyID &&
+ RetTy->getTypeID() != MetadataTyID;
}
/// isValidArgumentType - Return true if the specified type is valid as an