[llvm-commits] [llvm] r45356 - in /llvm/trunk: lib/Linker/LinkModules.cpp lib/Transforms/IPO/ArgumentPromotion.cpp lib/Transforms/IPO/DeadArgumentElimination.cpp lib/Transforms/IPO/ExtractFunction.cpp tools/llvm2cpp/CppWriter.cpp
Gordon Henriksen
gordonhenriksen at mac.com
Tue Dec 25 14:16:09 PST 2007
Author: gordon
Date: Tue Dec 25 16:16:06 2007
New Revision: 45356
URL: http://llvm.org/viewvc/llvm-project?rev=45356&view=rev
Log:
Fixing several transforms which would drop the collector attribute
when copying functions.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/trunk/lib/Transforms/IPO/ExtractFunction.cpp
llvm/trunk/tools/llvm2cpp/CppWriter.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=45356&r1=45355&r2=45356&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Dec 25 16:16:06 2007
@@ -359,6 +359,8 @@
Function *DestF = cast<Function>(DestGV);
DestF->setCallingConv(SrcF->getCallingConv());
DestF->setParamAttrs(SrcF->getParamAttrs());
+ if (SrcF->hasCollector())
+ DestF->setCollector(SrcF->getCollector());
}
}
Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=45356&r1=45355&r2=45356&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Tue Dec 25 16:16:06 2007
@@ -424,6 +424,8 @@
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
Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=45356&r1=45355&r2=45356&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Dec 25 16:16:06 2007
@@ -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);
Modified: llvm/trunk/lib/Transforms/IPO/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractFunction.cpp?rev=45356&r1=45355&r2=45356&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ExtractFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ExtractFunction.cpp Tue Dec 25 16:16:06 2007
@@ -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();
Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm2cpp/CppWriter.cpp?rev=45356&r1=45355&r2=45356&view=diff
==============================================================================
--- llvm/trunk/tools/llvm2cpp/CppWriter.cpp (original)
+++ llvm/trunk/tools/llvm2cpp/CppWriter.cpp Tue Dec 25 16:16:06 2007
@@ -1572,6 +1572,11 @@
Out << ");";
nl(Out);
}
+ if (F->hasCollector()) {
+ printCppName(F);
+ Out << "->setCollector(\"" << F->getCollector() << "\");";
+ nl(Out);
+ }
if (is_inline) {
Out << "}";
nl(Out);
More information about the llvm-commits
mailing list