Lines Matching refs:GV
49 bool lowerGlobal(GlobalVariable *GV);
163 static bool rewriteNonInstructionUses(GlobalVariable *GV, Pass *P) {
165 for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I)
182 bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {
183 Module *M = GV->getParent();
185 if (!GV->isThreadLocal())
189 if (!rewriteNonInstructionUses(GV, this) ||
190 !GV->getType()->isSized() || isZeroLengthArray(GV->getType()))
194 ArrayType *NewType = createLoweredType(GV->getType()->getElementType());
196 if (GV->hasInitializer())
198 GV->getInitializer());
200 new GlobalVariable(*M, NewType, GV->isConstant(), GV->getLinkage(),
202 GV->getType()->getAddressSpace(),
203 GV->isExternallyInitialized());
206 SmallVector<User *, 16> Users(GV->use_begin(), GV->use_end());
211 Function *GetID = Intrinsic::getDeclaration(GV->getParent(),
218 U->replaceUsesOfWith(GV, Addr);
222 NewGV->takeName(GV);
223 GV->eraseFromParent();
233 GlobalVariable *GV = GVI;
234 if (GV->isThreadLocal())
235 ThreadLocalGlobals.push_back(GV);