Lines Matching defs:GO

302     if (auto *GO = dyn_cast<GlobalObject>(GV))
303 Used.insert(GO);
594 static const MCSymbolELF *getLinkedToSymbol(const GlobalObject *GO,
596 MDNode *MD = GO->getMetadata(LLVMContext::MD_associated);
650 getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind,
655 getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO));
660 Align Alignment = GO->getDataLayout().getPreferredAlign(
661 cast<GlobalVariable>(GO));
673 if (const auto *F = dyn_cast<Function>(GO)) {
694 TM.getNameWithPrefix(Name, GO, Mang, /*MayAlwaysUsePrivate*/true);
717 calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName,
730 const bool Associated = GO->getMetadata(LLVMContext::MD_associated);
785 GO, Kind, Mang, TM, EntrySize, false, /*MJTE=*/nullptr);
797 getGlobalObjectInfo(const GlobalObject *GO, const TargetMachine &TM) {
801 if (const Comdat *C = getELFComdat(GO)) {
806 if (TM.isLargeGlobalValue(GO))
811 static StringRef handlePragmaClangSection(const GlobalObject *GO,
816 const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
829 return GO->getSection();
832 static MCSection *selectExplicitSectionGlobal(const GlobalObject *GO,
838 StringRef SectionName = handlePragmaClangSection(GO, Kind);
844 auto [Group, IsComdat, ExtraFlags] = getGlobalObjectInfo(GO, TM);
849 GO, SectionName, Kind, TM, Ctx, Mang, Flags, EntrySize, NextUniqueID,
852 const MCSymbolELF *LinkedToSym = getLinkedToSymbol(GO, TM);
868 GO->getContext().diagnose(LoweringDiagnosticInfo(
869 "Symbol '" + GO->getName() + "' from module '" +
870 (GO->getParent() ? GO->getParent()->getSourceFileName() : "unknown") +
882 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
883 return selectExplicitSectionGlobal(GO, Kind, TM, getContext(), getMangler(),
884 NextUniqueID, Used.count(GO),
889 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang,
894 auto [Group, IsComdat, ExtraFlags] = getGlobalObjectInfo(GO, TM);
911 GO, Kind, Mang, TM, EntrySize, UniqueSectionName, MJTE);
922 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang,
925 const MCSymbolELF *LinkedToSym = getLinkedToSymbol(GO, TM);
942 Ctx, GO, Kind, Mang, TM, EmitUniqueSection, Flags,
949 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
961 EmitUniqueSection |= GO->hasComdat();
962 return selectELFSectionForGlobal(getContext(), GO, Kind, getMangler(), TM,
963 Used.count(GO), EmitUniqueSection, Flags,
1330 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1332 StringRef SectionName = handlePragmaClangSection(GO, Kind);
1339 checkMachOComdat(GO);
1344 report_fatal_error("Global variable '" + GO->getName() +
1346 GO->getSection() + "': " + toString(std::move(E)) + ".");
1363 report_fatal_error("Global variable '" + GO->getName() +
1372 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1373 checkMachOComdat(GO);
1380 return GO->isWeakForLinker() ? TextCoalSection : TextSection;
1384 if (GO->isWeakForLinker()) {
1394 GO->getDataLayout().getPreferredAlign(
1395 cast<GlobalVariable>(GO)) < Align(32))
1401 if (Kind.isMergeable2ByteCString() && !GO->hasExternalLinkage() &&
1402 GO->getDataLayout().getPreferredAlign(
1403 cast<GlobalVariable>(GO)) < Align(32))
1408 if (GO->hasPrivateLinkage() && Kind.isMergeableConst()) {
1604 if (auto *GO = GV->getAliaseeObject()) {
1605 SectionKind GOKind = TargetLoweringObjectFile::getKindForGlobal(GO, TM);
1606 const MCSection *TheSection = SectionForGlobal(GO, GOKind, TM);
1700 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1701 StringRef Name = handlePragmaClangSection(GO, Kind);
1714 if (GO->hasComdat()) {
1715 Selection = getSelectionForCOFF(GO);
1718 ComdatGV = getComdatGVForCOFF(GO);
1720 ComdatGV = GO;
1748 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
1757 if ((EmitUniquedSection && !Kind.isCommon()) || GO->hasComdat()) {
1763 int Selection = getSelectionForCOFF(GO);
1767 if (GO->hasComdat())
1768 ComdatGV = getComdatGVForCOFF(GO);
1770 ComdatGV = GO;
1780 if (const auto *F = dyn_cast<Function>(GO))
1794 getMangler().getNameWithPrefix(TmpData, GO, /*CannotUsePrivateLabel=*/true);
2186 if (auto *GO = dyn_cast<GlobalObject>(GV))
2187 Used.insert(GO);
2191 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2194 if (isa<Function>(GO)) {
2195 return SelectSectionForGlobal(GO, Kind, TM);
2198 StringRef Name = GO->getSection();
2213 if (const Comdat *C = getWasmComdat(GO)) {
2217 unsigned Flags = getWasmSectionFlags(Kind, Used.count(GO));
2225 selectWasmSectionForGlobal(MCContext &Ctx, const GlobalObject *GO,
2230 if (const Comdat *C = getWasmComdat(GO)) {
2237 if (const auto *F = dyn_cast<Function>(GO)) {
2245 TM.getNameWithPrefix(Name, GO, Mang, true);
2258 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2270 EmitUniqueSection |= GO->hasComdat();
2271 bool Retain = Used.count(GO);
2274 return selectWasmSectionForGlobal(getContext(), GO, Kind, getMangler(), TM,
2374 // It is inherently ambiguous when the GO represents the address of a
2375 // function, as the GO could either represent a function descriptor or a
2378 if (const GlobalObject *GO = dyn_cast<GlobalObject>(GV)) {
2379 if (GO->isDeclarationForLinker())
2380 return cast<MCSectionXCOFF>(getSectionForExternalReference(GO, TM))
2389 SectionKind GOKind = getKindForGlobal(GO, TM);
2392 getSectionForFunctionDescriptor(cast<Function>(GO), TM))
2394 if ((TM.getDataSections() && !GO->hasSection()) || GO->hasCommonLinkage() ||
2396 return cast<MCSectionXCOFF>(SectionForGlobal(GO, GOKind, TM))
2405 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2406 if (!GO->hasSection())
2409 StringRef SectionName = GO->getSection();
2412 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2438 const GlobalObject *GO, const TargetMachine &TM) const {
2439 assert(GO->isDeclarationForLinker() &&
2443 getNameWithPrefix(Name, GO, TM);
2447 if (GO->getThreadLocalMode() == GlobalVariable::LocalDynamicTLSModel &&
2448 GO->hasName() && GO->getName() == "_$TLSML") {
2455 isa<Function>(GO) ? XCOFF::XMC_DS : XCOFF::XMC_UA;
2456 if (GO->isThreadLocal())
2459 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2470 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2472 if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO))
2475 getNameWithPrefix(Name, GO, TM);
2477 GO->hasCommonLinkage() ? XCOFF::XTY_CM : XCOFF::XTY_SD;
2487 if (Kind.isBSSLocal() || GO->hasCommonLinkage() || Kind.isThreadBSSLocal()) {
2489 getNameWithPrefix(Name, GO, TM);
2499 return cast<MCSymbolXCOFF>(getFunctionEntryPointSymbol(GO, TM))
2511 getNameWithPrefix(Name, GO, TM);
2524 getNameWithPrefix(Name, GO, TM);
2535 getNameWithPrefix(Name, GO, TM);
2550 getNameWithPrefix(Name, GO, TM);
2757 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2758 return SelectSectionForGlobal(GO, Kind, TM);
2768 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
2769 auto *Symbol = TM.getSymbol(GO);