Lines Matching refs:Kind
590 static unsigned getEntrySizeForKind(SectionKind Kind) { in getEntrySizeForKind() argument
591 if (Kind.isMergeable1ByteCString()) in getEntrySizeForKind()
593 else if (Kind.isMergeable2ByteCString()) in getEntrySizeForKind()
595 else if (Kind.isMergeable4ByteCString()) in getEntrySizeForKind()
597 else if (Kind.isMergeableConst4()) in getEntrySizeForKind()
599 else if (Kind.isMergeableConst8()) in getEntrySizeForKind()
601 else if (Kind.isMergeableConst16()) in getEntrySizeForKind()
603 else if (Kind.isMergeableConst32()) in getEntrySizeForKind()
608 assert(!Kind.isMergeableCString() && "unknown string width"); in getEntrySizeForKind()
609 assert(!Kind.isMergeableConst() && "unknown data width"); in getEntrySizeForKind()
616 static StringRef getSectionPrefixForGlobal(SectionKind Kind, bool IsLarge) { in getSectionPrefixForGlobal() argument
617 if (Kind.isText()) in getSectionPrefixForGlobal()
619 if (Kind.isReadOnly()) in getSectionPrefixForGlobal()
621 if (Kind.isBSS()) in getSectionPrefixForGlobal()
623 if (Kind.isThreadData()) in getSectionPrefixForGlobal()
625 if (Kind.isThreadBSS()) in getSectionPrefixForGlobal()
627 if (Kind.isData()) in getSectionPrefixForGlobal()
629 if (Kind.isReadOnlyWithRel()) in getSectionPrefixForGlobal()
635 getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind, in getELFSectionNameForGlobal() argument
639 if (Kind.isMergeableCString()) { in getELFSectionNameForGlobal()
648 } else if (Kind.isMergeableConst()) { in getELFSectionNameForGlobal()
652 Name = getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO)); in getELFSectionNameForGlobal()
689 SectionKind Kind, const TargetMachine &TM, in calcUniqueIDUpdateFlagsAndSize() argument
751 getELFSectionNameForGlobal(GO, Kind, Mang, TM, EntrySize, false); in calcUniqueIDUpdateFlagsAndSize()
778 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM, in selectExplicitSectionGlobal() argument
789 if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) { in selectExplicitSectionGlobal()
791 } else if (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly()) { in selectExplicitSectionGlobal()
793 } else if (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) { in selectExplicitSectionGlobal()
795 } else if (Attrs.hasAttribute("data-section") && Kind.isData()) { in selectExplicitSectionGlobal()
805 Kind = getELFKindForNamedSection(SectionName, Kind); in selectExplicitSectionGlobal()
807 unsigned Flags = getELFSectionFlags(Kind); in selectExplicitSectionGlobal()
811 unsigned EntrySize = getEntrySizeForKind(Kind); in selectExplicitSectionGlobal()
813 GO, SectionName, Kind, TM, Ctx, Mang, Flags, EntrySize, NextUniqueID, in selectExplicitSectionGlobal()
818 SectionName, getELFSectionType(SectionName, Kind), Flags, EntrySize, in selectExplicitSectionGlobal()
831 (Section->getEntrySize() != getEntrySizeForKind(Kind))) in selectExplicitSectionGlobal()
836 Twine(getEntrySizeForKind(Kind)) + " but was placed in section '" + in selectExplicitSectionGlobal()
846 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
847 return selectExplicitSectionGlobal(GO, Kind, TM, getContext(), getMangler(), in getExplicitSectionGlobal()
853 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
861 unsigned EntrySize = getEntrySizeForKind(Kind); in selectELFSectionForGlobal()
874 GO, Kind, Mang, TM, EntrySize, UniqueSectionName); in selectELFSectionForGlobal()
877 if (Kind.isExecuteOnly()) in selectELFSectionForGlobal()
879 return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags, in selectELFSectionForGlobal()
885 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
905 Ctx, GO, Kind, Mang, TM, EmitUniqueSection, Flags, in selectELFSectionForGlobal()
912 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
913 unsigned Flags = getELFSectionFlags(Kind); in SelectSectionForGlobal()
918 if (!(Flags & ELF::SHF_MERGE) && !Kind.isCommon()) { in SelectSectionForGlobal()
919 if (Kind.isText()) in SelectSectionForGlobal()
925 return selectELFSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
932 SectionKind Kind = SectionKind::getText(); in getUniqueSectionForFunction() local
933 unsigned Flags = getELFSectionFlags(Kind); in getUniqueSectionForFunction()
938 &F, Kind, TM, getContext(), getMangler(), NextUniqueID, in getUniqueSectionForFunction()
942 getContext(), &F, Kind, getMangler(), TM, Used.count(&F), in getUniqueSectionForFunction()
1006 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1008 if (Kind.isMergeableConst4() && MergeableConst4Section) in getSectionForConstant()
1010 if (Kind.isMergeableConst8() && MergeableConst8Section) in getSectionForConstant()
1012 if (Kind.isMergeableConst16() && MergeableConst16Section) in getSectionForConstant()
1014 if (Kind.isMergeableConst32() && MergeableConst32Section) in getSectionForConstant()
1016 if (Kind.isReadOnly()) in getSectionForConstant()
1019 assert(Kind.isReadOnlyWithRel() && "Unknown section kind"); in getSectionForConstant()
1282 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1289 if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) { in getExplicitSectionGlobal()
1291 } else if (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly()) { in getExplicitSectionGlobal()
1293 } else if (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) { in getExplicitSectionGlobal()
1295 } else if (Attrs.hasAttribute("data-section") && Kind.isData()) { in getExplicitSectionGlobal()
1322 getContext().getMachOSection(Segment, Section, TAA, StubSize, Kind); in getExplicitSectionGlobal()
1343 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1347 if (Kind.isThreadBSS()) return TLSBSSSection; in SelectSectionForGlobal()
1348 if (Kind.isThreadData()) return TLSDataSection; in SelectSectionForGlobal()
1350 if (Kind.isText()) in SelectSectionForGlobal()
1356 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1358 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1364 if (Kind.isMergeable1ByteCString() && in SelectSectionForGlobal()
1372 if (Kind.isMergeable2ByteCString() && !GO->hasExternalLinkage() && in SelectSectionForGlobal()
1379 if (GO->hasPrivateLinkage() && Kind.isMergeableConst()) { in SelectSectionForGlobal()
1380 if (Kind.isMergeableConst4()) in SelectSectionForGlobal()
1382 if (Kind.isMergeableConst8()) in SelectSectionForGlobal()
1384 if (Kind.isMergeableConst16()) in SelectSectionForGlobal()
1390 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1395 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1400 if (Kind.isBSSExtern()) in SelectSectionForGlobal()
1405 if (Kind.isBSSLocal()) in SelectSectionForGlobal()
1413 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1417 if (Kind.isData() || Kind.isReadOnlyWithRel()) in getSectionForConstant()
1420 if (Kind.isMergeableConst4()) in getSectionForConstant()
1422 if (Kind.isMergeableConst8()) in getSectionForConstant()
1424 if (Kind.isMergeableConst16()) in getSectionForConstant()
1671 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1681 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
1683 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getExplicitSectionGlobal()
1702 return getContext().getCOFFSection(Name, Characteristics, Kind, COMDATSymName, in getExplicitSectionGlobal()
1706 static StringRef getCOFFSectionNameForUniqueGlobal(SectionKind Kind) { in getCOFFSectionNameForUniqueGlobal() argument
1707 if (Kind.isText()) in getCOFFSectionNameForUniqueGlobal()
1709 if (Kind.isBSS()) in getCOFFSectionNameForUniqueGlobal()
1711 if (Kind.isThreadLocal()) in getCOFFSectionNameForUniqueGlobal()
1713 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in getCOFFSectionNameForUniqueGlobal()
1719 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1723 if (Kind.isText()) in SelectSectionForGlobal()
1728 if ((EmitUniquedSection && !Kind.isCommon()) || GO->hasComdat()) { in SelectSectionForGlobal()
1729 SmallString<256> Name = getCOFFSectionNameForUniqueGlobal(Kind); in SelectSectionForGlobal()
1731 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in SelectSectionForGlobal()
1761 return getContext().getCOFFSection(Name, Characteristics, Kind, in SelectSectionForGlobal()
1766 return getContext().getCOFFSection(Name, Characteristics, Kind, TmpData, in SelectSectionForGlobal()
1771 if (Kind.isText()) in SelectSectionForGlobal()
1774 if (Kind.isThreadLocal()) in SelectSectionForGlobal()
1777 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1783 if (Kind.isBSS() || Kind.isCommon()) in SelectSectionForGlobal()
1817 SectionKind Kind = SectionKind::getReadOnly(); in getSectionForJumpTable() local
1818 StringRef SecName = getCOFFSectionNameForUniqueGlobal(Kind); in getSectionForJumpTable()
1819 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getSectionForJumpTable()
1824 SecName, Characteristics, Kind, COMDATSymName, in getSectionForJumpTable()
2082 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2084 if (Kind.isMergeableConst() && C && in getSectionForConstant()
2094 if (Kind.isMergeableConst4()) { in getSectionForConstant()
2099 } else if (Kind.isMergeableConst8()) { in getSectionForConstant()
2104 } else if (Kind.isMergeableConst16()) { in getSectionForConstant()
2110 } else if (Kind.isMergeableConst32()) { in getSectionForConstant()
2118 return getContext().getCOFFSection(".rdata", Characteristics, Kind, in getSectionForConstant()
2123 return TargetLoweringObjectFile::getSectionForConstant(DL, Kind, C, in getSectionForConstant()
2159 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2163 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2174 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
2181 unsigned Flags = getWasmSectionFlags(Kind); in getExplicitSectionGlobal()
2183 Name, Kind, Flags, Group, MCContext::GenericSectionID); in getExplicitSectionGlobal()
2189 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectWasmSectionForGlobal() argument
2197 SmallString<128> Name = getSectionPrefixForGlobal(Kind, /*IsLarge=*/false); in selectWasmSectionForGlobal()
2215 unsigned Flags = getWasmSectionFlags(Kind); in selectWasmSectionForGlobal()
2216 return Ctx.getWasmSection(Name, Kind, Flags, Group, UniqueID); in selectWasmSectionForGlobal()
2220 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2222 if (Kind.isCommon()) in SelectSectionForGlobal()
2228 if (Kind.isText()) in SelectSectionForGlobal()
2234 return selectWasmSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
2365 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2375 SectionName, Kind, in getExplicitSectionGlobal()
2380 if (Kind.isText()) in getExplicitSectionGlobal()
2382 else if (Kind.isData() || Kind.isBSS()) in getExplicitSectionGlobal()
2384 else if (Kind.isReadOnlyWithRel()) in getExplicitSectionGlobal()
2387 else if (Kind.isReadOnly()) in getExplicitSectionGlobal()
2393 SectionName, Kind, XCOFF::CsectProperties(MappingClass, XCOFF::XTY_SD), in getExplicitSectionGlobal()
2421 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2428 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TD, XCOFF::XTY_SD), in SelectSectionForGlobal()
2436 if (Kind.isBSSLocal() || GO->hasCommonLinkage() || Kind.isThreadBSSLocal()) { in SelectSectionForGlobal()
2439 XCOFF::StorageMappingClass SMC = Kind.isBSSLocal() ? XCOFF::XMC_BS in SelectSectionForGlobal()
2440 : Kind.isCommon() ? XCOFF::XMC_RW in SelectSectionForGlobal()
2443 Name, Kind, XCOFF::CsectProperties(SMC, XCOFF::XTY_CM)); in SelectSectionForGlobal()
2446 if (Kind.isText()) { in SelectSectionForGlobal()
2454 if (TM.Options.XCOFFReadOnlyPointers && Kind.isReadOnlyWithRel()) { in SelectSectionForGlobal()
2470 if (Kind.isData() || Kind.isReadOnlyWithRel() || Kind.isBSS()) { in SelectSectionForGlobal()
2481 if (Kind.isReadOnly()) { in SelectSectionForGlobal()
2496 if (Kind.isThreadLocal()) { in SelectSectionForGlobal()
2501 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TL, XCOFF::XTY_SD)); in SelectSectionForGlobal()
2533 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2689 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2690 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2701 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2703 if (Kind.isBSS()) in SelectSectionForGlobal()