Lines Matching defs:DGV
462 GlobalValue *DGV = DstM.getNamedValue(SrcGV->getName());
463 if (!DGV)
468 if (DGV->hasLocalLinkage())
472 return DGV;
480 bool shouldLink(GlobalValue *DGV, GlobalValue &SGV);
795 GlobalValue *DGV = getLinkedToGlobal(&SGV);
796 if (!DGV)
799 if (!DGV->hasAppendingLinkage() || !SGV.hasAppendingLinkage()) {
800 TypeMap.addTypeMapping(DGV->getType(), SGV.getType());
805 ArrayType *DAT = cast<ArrayType>(DGV->getType()->getElementType());
811 if (GlobalValue *DGV = getLinkedToGlobal(&SGV))
812 TypeMap.addTypeMapping(DGV->getType(), SGV.getType());
815 if (GlobalValue *DGV = getLinkedToGlobal(&SGV))
816 TypeMap.addTypeMapping(DGV->getType(), SGV.getType());
957 GlobalValue *DGV = getLinkedToGlobal(Key);
958 return !shouldLink(DGV, *Key);
1008 static bool useExistingDest(GlobalValue &SGV, GlobalValue *DGV,
1010 if (!DGV)
1016 if (DGV->isDeclarationForLinker() && !SGV.isDeclarationForLinker())
1025 bool IRLinker::shouldLink(GlobalValue *DGV, GlobalValue &SGV) {
1040 if (DGV && !DGV->isDeclaration())
1054 GlobalValue *DGV = getLinkedToGlobal(SGV);
1056 bool ShouldLink = shouldLink(DGV, *SGV);
1069 DGV = nullptr;
1071 DGV = getLinkedToGlobal(SGV);
1074 assert(!DGV || SGV->hasAppendingLinkage() == DGV->hasAppendingLinkage());
1076 return linkAppendingVarProto(cast_or_null<GlobalVariable>(DGV),
1080 if (useExistingDest(*SGV, DGV, ShouldLink)) {
1081 NewGV = DGV;
1107 if (DGV)
1110 if (DGV && NewGV != DGV) {
1111 DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewGV, DGV->getType()));
1112 DGV->eraseFromParent();