diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-09-27 07:55:32 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-09-27 07:55:32 +0000 |
commit | 14d1cccc2be9ecde362183a50d4d15c169e0c813 (patch) | |
tree | ee983d3020c05903f807ae8f113ef18d591d094e /llvm/lib | |
parent | 42fb7452dfbc20c31c97c2d88ef5e6019323377a (diff) | |
download | bcm5719-llvm-14d1cccc2be9ecde362183a50d4d15c169e0c813.tar.gz bcm5719-llvm-14d1cccc2be9ecde362183a50d4d15c169e0c813.zip |
Remove dead code from this function and optimize. Update its corresponding
LangRef entry too.
llvm-svn: 82890
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Type.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 0883cc304b1..da53800ad7e 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/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<PointerType>(RetTy)) - return PTy->getElementType()->getTypeID() != MetadataTyID; - return true; - } - if (RetTy->getTypeID() == VoidTyID || RetTy->getTypeID() == MetadataTyID || - isa<OpaqueType>(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<StructType>(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<PointerType>(RetTy)) + return PTy->getElementType()->getTypeID() != MetadataTyID; + + return RetTy->getTypeID() != LabelTyID && + RetTy->getTypeID() != MetadataTyID; } /// isValidArgumentType - Return true if the specified type is valid as an |