Lines Matching refs:GV
450 auto mayPreserveGlobal = [&](GlobalValue &GV) { in preserveDiscardableGVs() argument
451 if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || in preserveDiscardableGVs()
452 !mustPreserveGV(GV)) in preserveDiscardableGVs()
454 if (GV.hasAvailableExternallyLinkage()) in preserveDiscardableGVs()
457 GV.getName() + "'").str()); in preserveDiscardableGVs()
458 if (GV.hasInternalLinkage()) in preserveDiscardableGVs()
460 GV.getName() + "'").str()); in preserveDiscardableGVs()
461 Used.push_back(&GV); in preserveDiscardableGVs()
463 for (auto &GV : TheModule) in preserveDiscardableGVs() local
464 mayPreserveGlobal(GV); in preserveDiscardableGVs()
465 for (auto &GV : TheModule.globals()) in preserveDiscardableGVs() local
466 mayPreserveGlobal(GV); in preserveDiscardableGVs()
467 for (auto &GV : TheModule.aliases()) in preserveDiscardableGVs() local
468 mayPreserveGlobal(GV); in preserveDiscardableGVs()
484 auto mustPreserveGV = [&](const GlobalValue &GV) -> bool { in applyScopeRestrictions() argument
486 if (!GV.hasName()) in applyScopeRestrictions()
493 MangledName.reserve(GV.getName().size() + 1); in applyScopeRestrictions()
494 Mang.getNameWithPrefix(MangledName, &GV, /*CannotUsePrivateLabel=*/false); in applyScopeRestrictions()
508 auto RecordLinkage = [&](const GlobalValue &GV) { in applyScopeRestrictions() argument
509 if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() && in applyScopeRestrictions()
510 GV.hasName()) in applyScopeRestrictions()
511 ExternalSymbols.insert(std::make_pair(GV.getName(), GV.getLinkage())); in applyScopeRestrictions()
513 for (auto &GV : *MergedModule) in applyScopeRestrictions()
514 RecordLinkage(GV); in applyScopeRestrictions()
515 for (auto &GV : MergedModule->globals()) in applyScopeRestrictions() local
516 RecordLinkage(GV); in applyScopeRestrictions()
517 for (auto &GV : MergedModule->aliases()) in applyScopeRestrictions() local
518 RecordLinkage(GV); in applyScopeRestrictions()
541 auto externalize = [this](GlobalValue &GV) { in restoreLinkageForExternals() argument
542 if (!GV.hasLocalLinkage() || !GV.hasName()) in restoreLinkageForExternals()
545 auto I = ExternalSymbols.find(GV.getName()); in restoreLinkageForExternals()
549 GV.setLinkage(I->second); in restoreLinkageForExternals()