mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
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
This commit is contained in:
parent
64910eeec4
commit
194c90ed2a
@ -359,6 +359,8 @@ static void CopyGVAttributes(GlobalValue *DestGV, const GlobalValue *SrcGV) {
|
||||
Function *DestF = cast<Function>(DestGV);
|
||||
DestF->setCallingConv(SrcF->getCallingConv());
|
||||
DestF->setParamAttrs(SrcF->getParamAttrs());
|
||||
if (SrcF->hasCollector())
|
||||
DestF->setCollector(SrcF->getCollector());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -1572,6 +1572,11 @@ void CppWriter::printFunctionHead(const Function* F) {
|
||||
Out << ");";
|
||||
nl(Out);
|
||||
}
|
||||
if (F->hasCollector()) {
|
||||
printCppName(F);
|
||||
Out << "->setCollector(\"" << F->getCollector() << "\");";
|
||||
nl(Out);
|
||||
}
|
||||
if (is_inline) {
|
||||
Out << "}";
|
||||
nl(Out);
|
||||
|
Loading…
x
Reference in New Issue
Block a user