Fixing several transforms which would drop the collector attribute
when copying functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45356 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp
index e5b2d41..013fefe 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/lib/Transforms/IPO/ExtractFunction.cpp
@@ -96,6 +96,8 @@
GlobalValue::ExternalLinkage);
New->setCallingConv(I->getCallingConv());
New->setParamAttrs(I->getParamAttrs());
+ if (I->hasCollector())
+ New->setCollector(I->getCollector());
// If it's not the named function, delete the body of the function
I->dropAllReferences();