Lines Matching refs:GV
51 void addLazyFor(GlobalValue &GV, const IRMover::ValueAdder &Add);
104 void dropReplacedComdat(GlobalValue &GV,
107 bool linkIfNeeded(GlobalValue &GV, SmallVectorImpl<GlobalValue *> &GVToClone);
328 bool ModuleLinker::linkIfNeeded(GlobalValue &GV, in linkIfNeeded() argument
330 GlobalValue *DGV = getLinkedToGlobal(&GV); in linkIfNeeded()
334 if (!GV.hasAppendingLinkage()) { in linkIfNeeded()
345 if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { in linkIfNeeded()
347 auto *SGVar = dyn_cast<GlobalVariable>(&GV); in linkIfNeeded()
367 getMinVisibility(DGV->getVisibility(), GV.getVisibility()); in linkIfNeeded()
369 GV.setVisibility(Visibility); in linkIfNeeded()
372 DGV->getUnnamedAddr(), GV.getUnnamedAddr()); in linkIfNeeded()
374 GV.setUnnamedAddr(UnnamedAddr); in linkIfNeeded()
378 (GV.hasLocalLinkage() || GV.hasLinkOnceLinkage() || in linkIfNeeded()
379 GV.hasAvailableExternallyLinkage())) in linkIfNeeded()
382 if (GV.isDeclaration()) in linkIfNeeded()
386 if (const Comdat *SC = GV.getComdat()) { in linkIfNeeded()
393 if (DGV && shouldLinkFromSource(LinkFromSrc, *DGV, GV)) in linkIfNeeded()
396 GVToClone.push_back(LinkFromSrc ? DGV : &GV); in linkIfNeeded()
398 ValuesToLink.insert(&GV); in linkIfNeeded()
402 void ModuleLinker::addLazyFor(GlobalValue &GV, const IRMover::ValueAdder &Add) { in addLazyFor() argument
404 if (!GV.hasLinkOnceLinkage() && !GV.hasAvailableExternallyLinkage() && in addLazyFor()
409 Internalize.insert(GV.getName()); in addLazyFor()
410 Add(GV); in addLazyFor()
412 const Comdat *SC = GV.getComdat(); in addLazyFor()
429 GlobalValue &GV, const DenseSet<const Comdat *> &ReplacedDstComdats) { in dropReplacedComdat() argument
430 Comdat *C = GV.getComdat(); in dropReplacedComdat()
435 if (GV.use_empty()) { in dropReplacedComdat()
436 GV.eraseFromParent(); in dropReplacedComdat()
440 if (auto *F = dyn_cast<Function>(&GV)) { in dropReplacedComdat()
442 } else if (auto *Var = dyn_cast<GlobalVariable>(&GV)) { in dropReplacedComdat()
445 auto &Alias = cast<GlobalAlias>(GV); in dropReplacedComdat()
495 for (GlobalAlias &GV : llvm::make_early_inc_range(DstM.aliases())) in run()
496 dropReplacedComdat(GV, ReplacedDstComdats); in run()
498 for (GlobalVariable &GV : llvm::make_early_inc_range(DstM.globals())) in run()
499 dropReplacedComdat(GV, ReplacedDstComdats); in run()
501 for (Function &GV : llvm::make_early_inc_range(DstM)) in run()
502 dropReplacedComdat(GV, ReplacedDstComdats); in run()
521 for (GlobalVariable &GV : SrcM->globals()) in run()
522 if (GV.hasLinkOnceLinkage()) in run()
523 if (const Comdat *SC = GV.getComdat()) in run()
524 LazyComdatMembers[SC].push_back(&GV); in run()
539 for (GlobalVariable &GV : SrcM->globals()) in run()
540 if (linkIfNeeded(GV, GVToClone)) in run()
559 for (GlobalValue *GV : GVToClone) { in run()
560 if (auto *Var = dyn_cast<GlobalVariable>(GV)) { in run()
572 emitError("linking '" + GV->getName() + in run()
578 GlobalValue *GV = ValuesToLink[I]; in run() local
579 const Comdat *SC = GV->getComdat(); in run()
593 for (GlobalValue *GV : ValuesToLink) in run()
594 Internalize.insert(GV->getName()); in run()
603 [this](GlobalValue &GV, IRMover::ValueAdder Add) { in run() argument
604 addLazyFor(GV, Add); in run()