Merge isObjectPointerWithTrustworthySize with getPointerSize. Use it when
[oota-llvm.git] / lib / Transforms / Utils / UnifyFunctionExitNodes.cpp
index ccb8287d796980518ae1874d28b9748a6f89f720..46d4adaaa1542a11479cfc852fecd4e40770c570 100644 (file)
@@ -116,7 +116,8 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
     ReturnInst::Create(F.getContext(), NULL, NewRetBlock);
   } else {
     // If the function doesn't return void... add a PHI node to the block...
-    PN = PHINode::Create(F.getReturnType(), "UnifiedRetVal");
+    PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(),
+                         "UnifiedRetVal");
     NewRetBlock->getInstList().push_back(PN);
     ReturnInst::Create(F.getContext(), PN, NewRetBlock);
   }