Lines Matching defs:GO

301     if (auto *GO = dyn_cast<GlobalObject>(GV))
302 Used.insert(GO);
580 static const MCSymbolELF *getLinkedToSymbol(const GlobalObject *GO,
582 MDNode *MD = GO->getMetadata(LLVMContext::MD_associated);
636 getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind,
640 getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO));
645 Align Alignment = GO->getDataLayout().getPreferredAlign(
646 cast<GlobalVariable>(GO));
658 if (const auto *F = dyn_cast<Function>(GO)) {
667 TM.getNameWithPrefix(Name, GO, Mang, /*MayAlwaysUsePrivate*/true);
690 calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName,
703 const bool Associated = GO->getMetadata(LLVMContext::MD_associated);
758 getELFSectionNameForGlobal(GO, Kind, Mang, TM, EntrySize, false);
770 getGlobalObjectInfo(const GlobalObject *GO, const TargetMachine &TM) {
774 if (const Comdat *C = getELFComdat(GO)) {
779 if (TM.isLargeGlobalValue(GO))
785 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM,
788 StringRef SectionName = GO->getSection();
793 const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
811 auto [Group, IsComdat, ExtraFlags] = getGlobalObjectInfo(GO, TM);
816 GO, SectionName, Kind, TM, Ctx, Mang, Flags, EntrySize, NextUniqueID,
819 const MCSymbolELF *LinkedToSym = getLinkedToSymbol(GO, TM);
835 GO->getContext().diagnose(LoweringDiagnosticInfo(
836 "Symbol '" + GO->getName() + "' from module '" +
837 (GO->getParent() ? GO->getParent()->getSourceFileName() : "unknown") +
849 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
850 return selectExplicitSectionGlobal(GO, Kind, TM, getContext(), getMangler(),
851 NextUniqueID, Used.count(GO),
856 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang,
860 auto [Group, IsComdat, ExtraFlags] = getGlobalObjectInfo(GO, TM);
877 GO, Kind, Mang, TM, EntrySize, UniqueSectionName);
888 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang,
891 const MCSymbolELF *LinkedToSym = getLinkedToSymbol(GO, TM);
908 Ctx, GO, Kind, Mang, TM, EmitUniqueSection, Flags,
915 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
927 EmitUniqueSection |= GO->hasComdat();
928 return selectELFSectionForGlobal(getContext(), GO, Kind, getMangler(), TM,
929 Used.count(GO), EmitUniqueSection, Flags,
1285 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1287 StringRef SectionName = GO->getSection();
1289 const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
1308 checkMachOComdat(GO);
1313 report_fatal_error("Global variable '" + GO->getName() +
1315 GO->getSection() + "': " + toString(std::move(E)) + ".");
1332 report_fatal_error("Global variable '" + GO->getName() +
1341 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1342 checkMachOComdat(GO);
1349 return GO->isWeakForLinker() ? TextCoalSection : TextSection;
1353 if (GO->isWeakForLinker()) {
1363 GO->getDataLayout().getPreferredAlign(
1364 cast<GlobalVariable>(GO)) < Align(32))
1370 if (Kind.isMergeable2ByteCString() && !GO->hasExternalLinkage() &&
1371 GO->getDataLayout().getPreferredAlign(
1372 cast<GlobalVariable>(GO)) < Align(32))
1377 if (GO->hasPrivateLinkage() && Kind.isMergeableConst()) {
1573 if (auto *GO = GV->getAliaseeObject()) {
1574 SectionKind GOKind = TargetLoweringObjectFile::getKindForGlobal(GO, TM);
1575 const MCSection *TheSection = SectionForGlobal(GO, GOKind, TM);
1669 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1670 StringRef Name = GO->getSection();
1683 if (GO->hasComdat()) {
1684 Selection = getSelectionForCOFF(GO);
1687 ComdatGV = getComdatGVForCOFF(GO);
1689 ComdatGV = GO;
1717 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1726 if ((EmitUniquedSection && !Kind.isCommon()) || GO->hasComdat()) {
1732 int Selection = getSelectionForCOFF(GO);
1736 if (GO->hasComdat())
1737 ComdatGV = getComdatGVForCOFF(GO);
1739 ComdatGV = GO;
1749 if (const auto *F = dyn_cast<Function>(GO))
1763 getMangler().getNameWithPrefix(TmpData, GO, /*CannotUsePrivateLabel=*/true);
2155 if (auto *GO = dyn_cast<GlobalObject>(GV))
2156 Used.insert(GO);
2160 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2163 if (isa<Function>(GO)) {
2164 return SelectSectionForGlobal(GO, Kind, TM);
2167 StringRef Name = GO->getSection();
2178 if (const Comdat *C = getWasmComdat(GO)) {
2182 unsigned Flags = getWasmSectionFlags(Kind, Used.count(GO));
2190 selectWasmSectionForGlobal(MCContext &Ctx, const GlobalObject *GO,
2195 if (const Comdat *C = getWasmComdat(GO)) {
2202 if (const auto *F = dyn_cast<Function>(GO)) {
2210 TM.getNameWithPrefix(Name, GO, Mang, true);
2223 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2235 EmitUniqueSection |= GO->hasComdat();
2236 bool Retain = Used.count(GO);
2239 return selectWasmSectionForGlobal(getContext(), GO, Kind, getMangler(), TM,
2339 // It is inherently ambiguous when the GO represents the address of a
2340 // function, as the GO could either represent a function descriptor or a
2343 if (const GlobalObject *GO = dyn_cast<GlobalObject>(GV)) {
2344 if (GO->isDeclarationForLinker())
2345 return cast<MCSectionXCOFF>(getSectionForExternalReference(GO, TM))
2354 SectionKind GOKind = getKindForGlobal(GO, TM);
2357 getSectionForFunctionDescriptor(cast<Function>(GO), TM))
2359 if ((TM.getDataSections() && !GO->hasSection()) || GO->hasCommonLinkage() ||
2361 return cast<MCSectionXCOFF>(SectionForGlobal(GO, GOKind, TM))
2370 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2371 if (!GO->hasSection())
2374 StringRef SectionName = GO->getSection();
2377 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2403 const GlobalObject *GO, const TargetMachine &TM) const {
2404 assert(GO->isDeclarationForLinker() &&
2408 getNameWithPrefix(Name, GO, TM);
2412 if (GO->getThreadLocalMode() == GlobalVariable::LocalDynamicTLSModel &&
2413 GO->hasName() && GO->getName() == "_$TLSML") {
2420 isa<Function>(GO) ? XCOFF::XMC_DS : XCOFF::XMC_UA;
2421 if (GO->isThreadLocal())
2424 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2435 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2437 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2440 getNameWithPrefix(Name, GO, TM);
2442 GO->hasCommonLinkage() ? XCOFF::XTY_CM : XCOFF::XTY_SD;
2452 if (Kind.isBSSLocal() || GO->hasCommonLinkage() || Kind.isThreadBSSLocal()) {
2454 getNameWithPrefix(Name, GO, TM);
2464 return cast<MCSymbolXCOFF>(getFunctionEntryPointSymbol(GO, TM))
2476 getNameWithPrefix(Name, GO, TM);
2489 getNameWithPrefix(Name, GO, TM);
2500 getNameWithPrefix(Name, GO, TM);
2515 getNameWithPrefix(Name, GO, TM);
2722 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2723 return SelectSectionForGlobal(GO, Kind, TM);
2733 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2734 auto *Symbol = TM.getSymbol(GO);