Lines Matching refs:GV
439 auto mayPreserveGlobal = [&](GlobalValue &GV) { in preserveDiscardableGVs() argument
440 if (!GV.isDiscardableIfUnused() || GV.isDeclaration() || in preserveDiscardableGVs()
441 !mustPreserveGV(GV)) in preserveDiscardableGVs()
443 if (GV.hasAvailableExternallyLinkage()) in preserveDiscardableGVs()
446 GV.getName() + "'").str()); in preserveDiscardableGVs()
447 if (GV.hasInternalLinkage()) in preserveDiscardableGVs()
449 GV.getName() + "'").str()); in preserveDiscardableGVs()
450 Used.push_back(&GV); in preserveDiscardableGVs()
452 for (auto &GV : TheModule) in preserveDiscardableGVs() local
453 mayPreserveGlobal(GV); in preserveDiscardableGVs()
454 for (auto &GV : TheModule.globals()) in preserveDiscardableGVs() local
455 mayPreserveGlobal(GV); in preserveDiscardableGVs()
456 for (auto &GV : TheModule.aliases()) in preserveDiscardableGVs() local
457 mayPreserveGlobal(GV); in preserveDiscardableGVs()
473 auto mustPreserveGV = [&](const GlobalValue &GV) -> bool { in applyScopeRestrictions() argument
475 if (!GV.hasName()) in applyScopeRestrictions()
482 MangledName.reserve(GV.getName().size() + 1); in applyScopeRestrictions()
483 Mang.getNameWithPrefix(MangledName, &GV, /*CannotUsePrivateLabel=*/false); in applyScopeRestrictions()
497 auto RecordLinkage = [&](const GlobalValue &GV) { in applyScopeRestrictions() argument
498 if (!GV.hasAvailableExternallyLinkage() && !GV.hasLocalLinkage() && in applyScopeRestrictions()
499 GV.hasName()) in applyScopeRestrictions()
500 ExternalSymbols.insert(std::make_pair(GV.getName(), GV.getLinkage())); in applyScopeRestrictions()
502 for (auto &GV : *MergedModule) in applyScopeRestrictions()
503 RecordLinkage(GV); in applyScopeRestrictions()
504 for (auto &GV : MergedModule->globals()) in applyScopeRestrictions() local
505 RecordLinkage(GV); in applyScopeRestrictions()
506 for (auto &GV : MergedModule->aliases()) in applyScopeRestrictions() local
507 RecordLinkage(GV); in applyScopeRestrictions()
530 auto externalize = [this](GlobalValue &GV) { in restoreLinkageForExternals() argument
531 if (!GV.hasLocalLinkage() || !GV.hasName()) in restoreLinkageForExternals()
534 auto I = ExternalSymbols.find(GV.getName()); in restoreLinkageForExternals()
538 GV.setLinkage(I->second); in restoreLinkageForExternals()