Lines Matching defs:GV
66 bool operator()(const GlobalValue &GV) {
68 ExternalNames, [&](GlobPattern &GP) { return GP.match(GV.getName()); });
103 bool InternalizePass::shouldPreserveGV(const GlobalValue &GV) {
105 if (GV.isDeclaration())
109 if (GV.hasAvailableExternallyLinkage())
113 if (GV.hasDLLExportStorageClass())
118 if (const auto *G = dyn_cast<GlobalVariable>(&GV))
123 if (GV.hasLocalLinkage())
127 if (AlwaysPreserved.count(GV.getName()))
130 return MustPreserveGV(GV);
134 GlobalValue &GV, DenseMap<const Comdat *, ComdatInfo> &ComdatMap) {
136 if (Comdat *C = GV.getComdat()) {
142 if (auto *GO = dyn_cast<GlobalObject>(&GV)) {
156 if (GV.hasLocalLinkage())
159 if (GV.hasLocalLinkage())
162 if (shouldPreserveGV(GV))
166 GV.setVisibility(GlobalValue::DefaultVisibility);
167 GV.setLinkage(GlobalValue::InternalLinkage);
171 // If GV is part of a comdat and is externally visible, update the comdat size
174 GlobalValue &GV, DenseMap<const Comdat *, ComdatInfo> &ComdatMap) {
175 Comdat *C = GV.getComdat();
181 if (shouldPreserveGV(GV))
196 for (GlobalVariable &GV : M.globals())
197 checkComdat(GV, ComdatMap);
253 for (auto &GV : M.globals()) {
254 if (!maybeInternalize(GV, ComdatMap))
259 LLVM_DEBUG(dbgs() << "Internalized gvar " << GV.getName() << "\n");