Lines Matching refs:GV
73 static unsigned getGVAlignmentLog2(const GlobalValue *GV, const TargetData &TD,
76 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
83 // If the GV has a specified alignment, take it into account.
84 if (GV->getAlignment() == 0)
87 unsigned GVAlign = Log2_32(GV->getAlignment());
90 // NumBits because the GV has an assigned section, obey it.
91 if (GVAlign > NumBits || GV->hasSection())
266 void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
267 if (GV->hasInitializer()) {
269 if (EmitSpecialLLVMGlobal(GV))
273 WriteAsOperand(OutStreamer.GetCommentOS(), GV,
274 /*PrintType=*/false, GV->getParent());
279 MCSymbol *GVSym = Mang->getSymbol(GV);
280 EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
282 if (!GV->hasInitializer()) // External globals require no extra code.
288 SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
291 uint64_t Size = TD->getTypeAllocSize(GV->getType()->getElementType());
296 unsigned AlignLog = getGVAlignmentLog2(GV, *TD);
316 getObjFileLowering().SectionForGlobal(GV, GVKind, Mang, TM);
340 getObjFileLowering().SectionForGlobal(GV, GVKind, Mang, TM);
374 EmitAlignment(AlignLog, GV);
377 EmitGlobalConstant(GV->getInitializer());
388 EmitLinkage(GV->getLinkage(), GVSym);
407 EmitLinkage(GV->getLinkage(), GVSym);
408 EmitAlignment(AlignLog, GV);
412 EmitGlobalConstant(GV->getInitializer());
927 const GlobalValue *GV = I->getAliasedGlobal();
928 MCSymbol *Target = Mang->getSymbol(GV);
1229 bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
1230 if (GV->getName() == "llvm.used") {
1232 EmitLLVMUsedList(GV->getInitializer());
1237 if (GV->getSection() == "llvm.metadata" ||
1238 GV->hasAvailableExternallyLinkage())
1241 if (!GV->hasAppendingLinkage()) return false;
1243 assert(GV->hasInitializer() && "Not a special LLVM global!");
1245 if (GV->getName() == "llvm.global_ctors") {
1246 EmitXXStructorList(GV->getInitializer(), /* isCtor */ true);
1257 if (GV->getName() == "llvm.global_dtors") {
1258 EmitXXStructorList(GV->getInitializer(), /* isCtor */ false);
1281 const GlobalValue *GV =
1283 if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, Mang))
1284 OutStreamer.EmitSymbolAttribute(Mang->getSymbol(GV), MCSA_NoDeadStrip);
1437 void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
1438 if (GV) NumBits = getGVAlignmentLog2(GV, *TM.getTargetData(), NumBits);
1463 if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV))
1464 return MCSymbolRefExpr::Create(AP.Mang->getSymbol(GV), Ctx);
2008 MCSymbol *AsmPrinter::GetSymbolWithGlobalValueBase(const GlobalValue *GV,
2012 Mang->getNameWithPrefix(NameStr, GV, ForcePrivate);