llvm.org GIT mirror llvm / 194c90e
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 Gordon Henriksen 11 years ago
5 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
358358 Function *DestF = cast(DestGV);
359359 DestF->setCallingConv(SrcF->getCallingConv());
360360 DestF->setParamAttrs(SrcF->getParamAttrs());
361 if (SrcF->hasCollector())
362 DestF->setCollector(SrcF->getCollector());
361363 }
362364 }
363365
423423 Function *NF = new Function(NFTy, F->getLinkage(), F->getName());
424424 NF->setCallingConv(F->getCallingConv());
425425 NF->setParamAttrs(PAL);
426 if (F->hasCollector())
427 NF->setCollector(F->getCollector());
426428 F->getParent()->getFunctionList().insert(F, NF);
427429
428430 // Get the alias analysis information that we need to update to reflect our
158158 Function *NF = new Function(NFTy, Fn.getLinkage());
159159 NF->setCallingConv(Fn.getCallingConv());
160160 NF->setParamAttrs(Fn.getParamAttrs());
161 if (Fn.hasCollector())
162 NF->setCollector(Fn.getCollector());
161163 Fn.getParent()->getFunctionList().insert(&Fn, NF);
162164 NF->takeName(&Fn);
163165
540542 Function *NF = new Function(NFTy, F->getLinkage());
541543 NF->setCallingConv(F->getCallingConv());
542544 NF->setParamAttrs(PAL);
545 if (F->hasCollector())
546 NF->setCollector(F->getCollector());
543547 F->getParent()->getFunctionList().insert(F, NF);
544548 NF->takeName(F);
545549
9595 GlobalValue::ExternalLinkage);
9696 New->setCallingConv(I->getCallingConv());
9797 New->setParamAttrs(I->getParamAttrs());
98 if (I->hasCollector())
99 New->setCollector(I->getCollector());
98100
99101 // If it's not the named function, delete the body of the function
100102 I->dropAllReferences();
15711571 Out << ");";
15721572 nl(Out);
15731573 }
1574 if (F->hasCollector()) {
1575 printCppName(F);
1576 Out << "->setCollector(\"" << F->getCollector() << "\");";
1577 nl(Out);
1578 }
15741579 if (is_inline) {
15751580 Out << "}";
15761581 nl(Out);