Lines Matching refs:Kind
591 static unsigned getEntrySizeForKind(SectionKind Kind) { in getEntrySizeForKind() argument
592 if (Kind.isMergeable1ByteCString()) in getEntrySizeForKind()
594 else if (Kind.isMergeable2ByteCString()) in getEntrySizeForKind()
596 else if (Kind.isMergeable4ByteCString()) in getEntrySizeForKind()
598 else if (Kind.isMergeableConst4()) in getEntrySizeForKind()
600 else if (Kind.isMergeableConst8()) in getEntrySizeForKind()
602 else if (Kind.isMergeableConst16()) in getEntrySizeForKind()
604 else if (Kind.isMergeableConst32()) in getEntrySizeForKind()
609 assert(!Kind.isMergeableCString() && "unknown string width"); in getEntrySizeForKind()
610 assert(!Kind.isMergeableConst() && "unknown data width"); in getEntrySizeForKind()
617 static StringRef getSectionPrefixForGlobal(SectionKind Kind, bool IsLarge) { in getSectionPrefixForGlobal() argument
618 if (Kind.isText()) in getSectionPrefixForGlobal()
620 if (Kind.isReadOnly()) in getSectionPrefixForGlobal()
622 if (Kind.isBSS()) in getSectionPrefixForGlobal()
624 if (Kind.isThreadData()) in getSectionPrefixForGlobal()
626 if (Kind.isThreadBSS()) in getSectionPrefixForGlobal()
628 if (Kind.isData()) in getSectionPrefixForGlobal()
630 if (Kind.isReadOnlyWithRel()) in getSectionPrefixForGlobal()
636 getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind, in getELFSectionNameForGlobal() argument
640 getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO)); in getELFSectionNameForGlobal()
641 if (Kind.isMergeableCString()) { in getELFSectionNameForGlobal()
652 } else if (Kind.isMergeableConst()) { in getELFSectionNameForGlobal()
691 SectionKind Kind, const TargetMachine &TM, in calcUniqueIDUpdateFlagsAndSize() argument
758 getELFSectionNameForGlobal(GO, Kind, Mang, TM, EntrySize, false); in calcUniqueIDUpdateFlagsAndSize()
785 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM, in selectExplicitSectionGlobal() argument
796 if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) { in selectExplicitSectionGlobal()
798 } else if (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly()) { in selectExplicitSectionGlobal()
800 } else if (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) { in selectExplicitSectionGlobal()
802 } else if (Attrs.hasAttribute("data-section") && Kind.isData()) { in selectExplicitSectionGlobal()
808 Kind = getELFKindForNamedSection(SectionName, Kind); in selectExplicitSectionGlobal()
810 unsigned Flags = getELFSectionFlags(Kind); in selectExplicitSectionGlobal()
814 unsigned EntrySize = getEntrySizeForKind(Kind); in selectExplicitSectionGlobal()
816 GO, SectionName, Kind, TM, Ctx, Mang, Flags, EntrySize, NextUniqueID, in selectExplicitSectionGlobal()
821 SectionName, getELFSectionType(SectionName, Kind), Flags, EntrySize, in selectExplicitSectionGlobal()
834 (Section->getEntrySize() != getEntrySizeForKind(Kind))) in selectExplicitSectionGlobal()
839 Twine(getEntrySizeForKind(Kind)) + " but was placed in section '" + in selectExplicitSectionGlobal()
849 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
850 return selectExplicitSectionGlobal(GO, Kind, TM, getContext(), getMangler(), in getExplicitSectionGlobal()
856 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
864 unsigned EntrySize = getEntrySizeForKind(Kind); in selectELFSectionForGlobal()
877 GO, Kind, Mang, TM, EntrySize, UniqueSectionName); in selectELFSectionForGlobal()
880 if (Kind.isExecuteOnly()) in selectELFSectionForGlobal()
882 return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags, in selectELFSectionForGlobal()
888 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
908 Ctx, GO, Kind, Mang, TM, EmitUniqueSection, Flags, in selectELFSectionForGlobal()
915 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
916 unsigned Flags = getELFSectionFlags(Kind); in SelectSectionForGlobal()
921 if (!(Flags & ELF::SHF_MERGE) && !Kind.isCommon()) { in SelectSectionForGlobal()
922 if (Kind.isText()) in SelectSectionForGlobal()
928 return selectELFSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
935 SectionKind Kind = SectionKind::getText(); in getUniqueSectionForFunction() local
936 unsigned Flags = getELFSectionFlags(Kind); in getUniqueSectionForFunction()
941 &F, Kind, TM, getContext(), getMangler(), NextUniqueID, in getUniqueSectionForFunction()
945 getContext(), &F, Kind, getMangler(), TM, Used.count(&F), in getUniqueSectionForFunction()
1009 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1011 if (Kind.isMergeableConst4() && MergeableConst4Section) in getSectionForConstant()
1013 if (Kind.isMergeableConst8() && MergeableConst8Section) in getSectionForConstant()
1015 if (Kind.isMergeableConst16() && MergeableConst16Section) in getSectionForConstant()
1017 if (Kind.isMergeableConst32() && MergeableConst32Section) in getSectionForConstant()
1019 if (Kind.isReadOnly()) in getSectionForConstant()
1022 assert(Kind.isReadOnlyWithRel() && "Unknown section kind"); in getSectionForConstant()
1285 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1292 if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) { in getExplicitSectionGlobal()
1294 } else if (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly()) { in getExplicitSectionGlobal()
1296 } else if (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) { in getExplicitSectionGlobal()
1298 } else if (Attrs.hasAttribute("data-section") && Kind.isData()) { in getExplicitSectionGlobal()
1320 getContext().getMachOSection(Segment, Section, TAA, StubSize, Kind); in getExplicitSectionGlobal()
1341 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1345 if (Kind.isThreadBSS()) return TLSBSSSection; in SelectSectionForGlobal()
1346 if (Kind.isThreadData()) return TLSDataSection; in SelectSectionForGlobal()
1348 if (Kind.isText()) in SelectSectionForGlobal()
1354 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1356 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1362 if (Kind.isMergeable1ByteCString() && in SelectSectionForGlobal()
1370 if (Kind.isMergeable2ByteCString() && !GO->hasExternalLinkage() && in SelectSectionForGlobal()
1377 if (GO->hasPrivateLinkage() && Kind.isMergeableConst()) { in SelectSectionForGlobal()
1378 if (Kind.isMergeableConst4()) in SelectSectionForGlobal()
1380 if (Kind.isMergeableConst8()) in SelectSectionForGlobal()
1382 if (Kind.isMergeableConst16()) in SelectSectionForGlobal()
1388 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1393 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1398 if (Kind.isBSSExtern()) in SelectSectionForGlobal()
1403 if (Kind.isBSSLocal()) in SelectSectionForGlobal()
1411 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1415 if (Kind.isData() || Kind.isReadOnlyWithRel()) in getSectionForConstant()
1418 if (Kind.isMergeableConst4()) in getSectionForConstant()
1420 if (Kind.isMergeableConst8()) in getSectionForConstant()
1422 if (Kind.isMergeableConst16()) in getSectionForConstant()
1669 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1679 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
1681 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getExplicitSectionGlobal()
1704 static StringRef getCOFFSectionNameForUniqueGlobal(SectionKind Kind) { in getCOFFSectionNameForUniqueGlobal() argument
1705 if (Kind.isText()) in getCOFFSectionNameForUniqueGlobal()
1707 if (Kind.isBSS()) in getCOFFSectionNameForUniqueGlobal()
1709 if (Kind.isThreadLocal()) in getCOFFSectionNameForUniqueGlobal()
1711 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in getCOFFSectionNameForUniqueGlobal()
1717 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1721 if (Kind.isText()) in SelectSectionForGlobal()
1726 if ((EmitUniquedSection && !Kind.isCommon()) || GO->hasComdat()) { in SelectSectionForGlobal()
1727 SmallString<256> Name = getCOFFSectionNameForUniqueGlobal(Kind); in SelectSectionForGlobal()
1729 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in SelectSectionForGlobal()
1769 if (Kind.isText()) in SelectSectionForGlobal()
1772 if (Kind.isThreadLocal()) in SelectSectionForGlobal()
1775 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1781 if (Kind.isBSS() || Kind.isCommon()) in SelectSectionForGlobal()
1815 SectionKind Kind = SectionKind::getReadOnly(); in getSectionForJumpTable() local
1816 StringRef SecName = getCOFFSectionNameForUniqueGlobal(Kind); in getSectionForJumpTable()
1817 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getSectionForJumpTable()
2072 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2074 if (Kind.isMergeableConst() && C && in getSectionForConstant()
2084 if (Kind.isMergeableConst4()) { in getSectionForConstant()
2089 } else if (Kind.isMergeableConst8()) { in getSectionForConstant()
2094 } else if (Kind.isMergeableConst16()) { in getSectionForConstant()
2100 } else if (Kind.isMergeableConst32()) { in getSectionForConstant()
2113 return TargetLoweringObjectFile::getSectionForConstant(DL, Kind, C, in getSectionForConstant()
2160 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2164 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2175 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
2182 unsigned Flags = getWasmSectionFlags(Kind, Used.count(GO)); in getExplicitSectionGlobal()
2184 Name, Kind, Flags, Group, MCContext::GenericSectionID); in getExplicitSectionGlobal()
2191 SectionKind Kind, Mangler &Mang, in selectWasmSectionForGlobal() argument
2200 SmallString<128> Name = getSectionPrefixForGlobal(Kind, /*IsLarge=*/false); in selectWasmSectionForGlobal()
2218 unsigned Flags = getWasmSectionFlags(Kind, Retain); in selectWasmSectionForGlobal()
2219 return Ctx.getWasmSection(Name, Kind, Flags, Group, UniqueID); in selectWasmSectionForGlobal()
2223 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2225 if (Kind.isCommon()) in SelectSectionForGlobal()
2231 if (Kind.isText()) in SelectSectionForGlobal()
2239 return selectWasmSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
2370 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2380 SectionName, Kind, in getExplicitSectionGlobal()
2385 if (Kind.isText()) in getExplicitSectionGlobal()
2387 else if (Kind.isData() || Kind.isBSS()) in getExplicitSectionGlobal()
2389 else if (Kind.isReadOnlyWithRel()) in getExplicitSectionGlobal()
2392 else if (Kind.isReadOnly()) in getExplicitSectionGlobal()
2398 SectionName, Kind, XCOFF::CsectProperties(MappingClass, XCOFF::XTY_SD), in getExplicitSectionGlobal()
2435 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2444 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TD, symType), in SelectSectionForGlobal()
2452 if (Kind.isBSSLocal() || GO->hasCommonLinkage() || Kind.isThreadBSSLocal()) { in SelectSectionForGlobal()
2455 XCOFF::StorageMappingClass SMC = Kind.isBSSLocal() ? XCOFF::XMC_BS in SelectSectionForGlobal()
2456 : Kind.isCommon() ? XCOFF::XMC_RW in SelectSectionForGlobal()
2459 Name, Kind, XCOFF::CsectProperties(SMC, XCOFF::XTY_CM)); in SelectSectionForGlobal()
2462 if (Kind.isText()) { in SelectSectionForGlobal()
2470 if (TM.Options.XCOFFReadOnlyPointers && Kind.isReadOnlyWithRel()) { in SelectSectionForGlobal()
2486 if (Kind.isData() || Kind.isReadOnlyWithRel() || Kind.isBSS()) { in SelectSectionForGlobal()
2497 if (Kind.isReadOnly()) { in SelectSectionForGlobal()
2512 if (Kind.isThreadLocal()) { in SelectSectionForGlobal()
2517 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TL, XCOFF::XTY_SD)); in SelectSectionForGlobal()
2549 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2722 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2723 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2733 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2735 if (Kind.isBSS()) in SelectSectionForGlobal()