Fix a (false) warning on darwin.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 25 Jun 2008 08:12:16 +0000 (08:12 +0000)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 25 Jun 2008 08:12:16 +0000 (08:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52705 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/DeadArgumentElimination.cpp

index 6a0d674787520a480ccd49afcbe3cb998047feae..4f05f4887a0b4af1a77c5cd70f3f1e0255bb49eb 100644 (file)
@@ -579,7 +579,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
   // Find out the new return value
 
   const Type *RetTy = FTy->getReturnType();
-  const Type *NRetTy;
+  const Type *NRetTy = NULL;
   unsigned RetCount = NumRetVals(F);
   // Explicitely track if anything changed, for debugging
   bool Changed = false;
@@ -632,6 +632,8 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
     NRetTy = Type::VoidTy;
   }
 
+  assert(NRetTy && "No new return type found?");
+
   // Remove any incompatible attributes
   RAttrs &= ~ParamAttr::typeIncompatible(NRetTy);
   if (RAttrs)