Lines Matching refs:GV
176 static bool UpgradeGlobalStructors(GlobalVariable *GV) {
177 ArrayType *ATy = dyn_cast<ArrayType>(GV->getType()->getElementType());
187 PointerType *VoidPtrTy = Type::getInt8Ty(GV->getContext())->getPointerTo();
194 StructType::get(GV->getContext(), Tys, /*isPacked=*/false);
197 Constant *OldInitC = GV->getInitializer();
213 // Replace the old GV with a new one.
217 *GV->getParent(), ATy, GV->isConstant(), GV->getLinkage(), NewInit, "",
218 GV, GV->getThreadLocalMode(), GV->getType()->getAddressSpace(),
219 GV->isExternallyInitialized());
220 NewGV->copyAttributesFrom(GV);
221 NewGV->takeName(GV);
222 assert(GV->use_empty() && "program cannot use initializer list");
223 GV->eraseFromParent();
227 bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
228 if (GV->getName() == "llvm.global_ctors" ||
229 GV->getName() == "llvm.global_dtors")
230 return UpgradeGlobalStructors(GV);