Fixing several transforms which would drop the collector attribute
when copying functions.

llvm-svn: 45356
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 6674ffd..d611307 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -159,6 +159,8 @@
   Function *NF = new Function(NFTy, Fn.getLinkage());
   NF->setCallingConv(Fn.getCallingConv());
   NF->setParamAttrs(Fn.getParamAttrs());
+  if (Fn.hasCollector())
+    NF->setCollector(Fn.getCollector());
   Fn.getParent()->getFunctionList().insert(&Fn, NF);
   NF->takeName(&Fn);
 
@@ -541,6 +543,8 @@
   Function *NF = new Function(NFTy, F->getLinkage());
   NF->setCallingConv(F->getCallingConv());
   NF->setParamAttrs(PAL);
+  if (F->hasCollector())
+    NF->setCollector(F->getCollector());
   F->getParent()->getFunctionList().insert(F, NF);
   NF->takeName(F);