diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-25 22:16:06 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-25 22:16:06 +0000 |
commit | 520e64c0c2140c00ddfa00368eca7fdb8723cec0 (patch) | |
tree | e92acc12813fbda8a1c2420718d592a91acb2f82 /llvm/lib/Transforms | |
parent | bea11173f5e8bb8f48495621a8437db8db94fad8 (diff) | |
download | bcm5719-llvm-520e64c0c2140c00ddfa00368eca7fdb8723cec0.tar.gz bcm5719-llvm-520e64c0c2140c00ddfa00368eca7fdb8723cec0.zip |
Fixing several transforms which would drop the collector attribute
when copying functions.
llvm-svn: 45356
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/ExtractFunction.cpp | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 26d8853891e..c66b28524eb 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -424,6 +424,8 @@ Function *ArgPromotion::DoPromotion(Function *F, Function *NF = new Function(NFTy, F->getLinkage(), F->getName()); NF->setCallingConv(F->getCallingConv()); NF->setParamAttrs(PAL); + if (F->hasCollector()) + NF->setCollector(F->getCollector()); F->getParent()->getFunctionList().insert(F, NF); // Get the alias analysis information that we need to update to reflect our diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index 6674ffdf7b8..d611307c2f9 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -159,6 +159,8 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { 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 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { 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); diff --git a/llvm/lib/Transforms/IPO/ExtractFunction.cpp b/llvm/lib/Transforms/IPO/ExtractFunction.cpp index e5b2d41d528..013fefef98f 100644 --- a/llvm/lib/Transforms/IPO/ExtractFunction.cpp +++ b/llvm/lib/Transforms/IPO/ExtractFunction.cpp @@ -96,6 +96,8 @@ namespace { 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(); |