Lines Matching defs:SF
538 Function *SF = dyn_cast<Function>(V);
539 if (!SF)
542 Function *DF = Function::Create(TypeMap.get(SF->getFunctionType()),
543 SF->getLinkage(), SF->getName(), DstM);
544 copyGVAttributes(DF, SF);
546 LazilyLinkFunctions.push_back(SF);
977 bool ModuleLinker::linkFunctionProto(Function *SF) {
978 GlobalValue *DGV = getLinkedToGlobal(SF);
980 bool HasUnnamedAddr = SF->hasUnnamedAddr();
984 if (const Comdat *SC = SF->getComdat()) {
995 if (getLinkageResult(DGV, SF, NewLinkage, NV, LinkFromSrc))
1010 ValueMap[SF] = ConstantExpr::getBitCast(DGV, TypeMap.get(SF->getType()));
1014 DoNotLinkFromSource.insert(SF);
1022 if (!DGV && (SF->hasLocalLinkage() || SF->hasLinkOnceLinkage() ||
1023 SF->hasAvailableExternallyLinkage())) {
1024 DoNotLinkFromSource.insert(SF);
1030 DoNotLinkFromSource.insert(SF);
1035 // bring SF over.
1036 Function *NewDF = Function::Create(TypeMap.get(SF->getFunctionType()),
1037 SF->getLinkage(), SF->getName(), DstM);
1038 copyGVAttributes(NewDF, SF);
1052 ValueMap[SF] = NewDF;
1479 for (Module::iterator SF = SrcM->begin(), E = SrcM->end(); SF != E; ++SF) {
1481 if (DoNotLinkFromSource.count(SF)) continue;
1483 Function *DF = cast<Function>(ValueMap[SF]);
1484 if (SF->hasPrefixData()) {
1487 SF->getPrefixData(), ValueMap, RF_None, &TypeMap, &ValMaterializer));
1491 if (SF->isDeclaration()) {
1492 if (!SF->isMaterializable())
1494 if (SF->Materialize(&ErrorMsg))
1498 linkFunctionBody(DF, SF);
1499 SF->Dematerialize();
1525 Function *SF = *I;
1526 if (!SF)
1529 Function *DF = cast<Function>(ValueMap[SF]);
1530 if (SF->hasPrefixData()) {
1532 DF->setPrefixData(MapValue(SF->getPrefixData(),
1540 if (SF->isDeclaration()) {
1541 if (!SF->isMaterializable())
1543 if (SF->Materialize(&ErrorMsg))
1552 linkFunctionBody(DF, SF);
1553 SF->Dematerialize();