Lines Matching refs:Kind
588 static unsigned getEntrySizeForKind(SectionKind Kind) { in getEntrySizeForKind() argument
589 if (Kind.isMergeable1ByteCString()) in getEntrySizeForKind()
591 else if (Kind.isMergeable2ByteCString()) in getEntrySizeForKind()
593 else if (Kind.isMergeable4ByteCString()) in getEntrySizeForKind()
595 else if (Kind.isMergeableConst4()) in getEntrySizeForKind()
597 else if (Kind.isMergeableConst8()) in getEntrySizeForKind()
599 else if (Kind.isMergeableConst16()) in getEntrySizeForKind()
601 else if (Kind.isMergeableConst32()) in getEntrySizeForKind()
606 assert(!Kind.isMergeableCString() && "unknown string width"); in getEntrySizeForKind()
607 assert(!Kind.isMergeableConst() && "unknown data width"); in getEntrySizeForKind()
614 static StringRef getSectionPrefixForGlobal(SectionKind Kind, bool IsLarge) { in getSectionPrefixForGlobal() argument
615 if (Kind.isText()) in getSectionPrefixForGlobal()
617 if (Kind.isReadOnly()) in getSectionPrefixForGlobal()
619 if (Kind.isBSS()) in getSectionPrefixForGlobal()
621 if (Kind.isThreadData()) in getSectionPrefixForGlobal()
623 if (Kind.isThreadBSS()) in getSectionPrefixForGlobal()
625 if (Kind.isData()) in getSectionPrefixForGlobal()
627 if (Kind.isReadOnlyWithRel()) in getSectionPrefixForGlobal()
633 getELFSectionNameForGlobal(const GlobalObject *GO, SectionKind Kind, in getELFSectionNameForGlobal() argument
638 getSectionPrefixForGlobal(Kind, TM.isLargeGlobalValue(GO)); in getELFSectionNameForGlobal()
639 if (Kind.isMergeableCString()) { in getELFSectionNameForGlobal()
650 } else if (Kind.isMergeableConst()) { in getELFSectionNameForGlobal()
706 SectionKind Kind, const TargetMachine &TM, in calcUniqueIDUpdateFlagsAndSize() argument
773 GO, Kind, Mang, TM, EntrySize, false, /*MJTE=*/nullptr); in calcUniqueIDUpdateFlagsAndSize()
800 SectionKind Kind) { in handlePragmaClangSection() argument
807 if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) in handlePragmaClangSection()
809 else if (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly()) in handlePragmaClangSection()
811 else if (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) in handlePragmaClangSection()
813 else if (Attrs.hasAttribute("data-section") && Kind.isData()) in handlePragmaClangSection()
821 SectionKind Kind, in selectExplicitSectionGlobal() argument
826 StringRef SectionName = handlePragmaClangSection(GO, Kind); in selectExplicitSectionGlobal()
829 Kind = getELFKindForNamedSection(SectionName, Kind); in selectExplicitSectionGlobal()
831 unsigned Flags = getELFSectionFlags(Kind, TM.getTargetTriple()); in selectExplicitSectionGlobal()
835 unsigned EntrySize = getEntrySizeForKind(Kind); in selectExplicitSectionGlobal()
837 GO, SectionName, Kind, TM, Ctx, Mang, Flags, EntrySize, NextUniqueID, in selectExplicitSectionGlobal()
842 SectionName, getELFSectionType(SectionName, Kind), Flags, EntrySize, in selectExplicitSectionGlobal()
855 (Section->getEntrySize() != getEntrySizeForKind(Kind))) in selectExplicitSectionGlobal()
860 Twine(getEntrySizeForKind(Kind)) + " but was placed in section '" + in selectExplicitSectionGlobal()
870 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
871 return selectExplicitSectionGlobal(GO, Kind, TM, getContext(), getMangler(), in getExplicitSectionGlobal()
877 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
886 unsigned EntrySize = getEntrySizeForKind(Kind); in selectELFSectionForGlobal()
899 GO, Kind, Mang, TM, EntrySize, UniqueSectionName, MJTE); in selectELFSectionForGlobal()
902 if (Kind.isExecuteOnly()) in selectELFSectionForGlobal()
904 return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags, in selectELFSectionForGlobal()
910 MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, in selectELFSectionForGlobal() argument
930 Ctx, GO, Kind, Mang, TM, EmitUniqueSection, Flags, in selectELFSectionForGlobal()
937 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
938 unsigned Flags = getELFSectionFlags(Kind, TM.getTargetTriple()); in SelectSectionForGlobal()
943 if (!(Flags & ELF::SHF_MERGE) && !Kind.isCommon()) { in SelectSectionForGlobal()
944 if (Kind.isText()) in SelectSectionForGlobal()
950 return selectELFSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
957 SectionKind Kind = SectionKind::getText(); in getUniqueSectionForFunction() local
958 unsigned Flags = getELFSectionFlags(Kind, TM.getTargetTriple()); in getUniqueSectionForFunction()
963 &F, Kind, TM, getContext(), getMangler(), NextUniqueID, in getUniqueSectionForFunction()
967 getContext(), &F, Kind, getMangler(), TM, Used.count(&F), in getUniqueSectionForFunction()
1037 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1039 if (Kind.isMergeableConst4() && MergeableConst4Section) in getSectionForConstant()
1041 if (Kind.isMergeableConst8() && MergeableConst8Section) in getSectionForConstant()
1043 if (Kind.isMergeableConst16() && MergeableConst16Section) in getSectionForConstant()
1045 if (Kind.isMergeableConst32() && MergeableConst32Section) in getSectionForConstant()
1047 if (Kind.isReadOnly()) in getSectionForConstant()
1050 assert(Kind.isReadOnlyWithRel() && "Unknown section kind"); in getSectionForConstant()
1055 const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment, in getSectionForConstant() argument
1060 return getSectionForConstant(DL, Kind, C, Alignment); in getSectionForConstant()
1063 if (Kind.isMergeableConst4() && MergeableConst4Section) in getSectionForConstant()
1067 if (Kind.isMergeableConst8() && MergeableConst8Section) in getSectionForConstant()
1071 if (Kind.isMergeableConst16() && MergeableConst16Section) in getSectionForConstant()
1075 if (Kind.isMergeableConst32() && MergeableConst32Section) in getSectionForConstant()
1079 if (Kind.isReadOnly()) in getSectionForConstant()
1083 assert(Kind.isReadOnlyWithRel() && "Unknown section kind"); in getSectionForConstant()
1361 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1363 StringRef SectionName = handlePragmaClangSection(GO, Kind); in getExplicitSectionGlobal()
1382 getContext().getMachOSection(Segment, Section, TAA, StubSize, Kind); in getExplicitSectionGlobal()
1403 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1407 if (Kind.isThreadBSS()) return TLSBSSSection; in SelectSectionForGlobal()
1408 if (Kind.isThreadData()) return TLSDataSection; in SelectSectionForGlobal()
1410 if (Kind.isText()) in SelectSectionForGlobal()
1416 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1418 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1424 if (Kind.isMergeable1ByteCString() && in SelectSectionForGlobal()
1432 if (Kind.isMergeable2ByteCString() && !GO->hasExternalLinkage() && in SelectSectionForGlobal()
1439 if (GO->hasPrivateLinkage() && Kind.isMergeableConst()) { in SelectSectionForGlobal()
1440 if (Kind.isMergeableConst4()) in SelectSectionForGlobal()
1442 if (Kind.isMergeableConst8()) in SelectSectionForGlobal()
1444 if (Kind.isMergeableConst16()) in SelectSectionForGlobal()
1450 if (Kind.isReadOnly()) in SelectSectionForGlobal()
1455 if (Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1460 if (Kind.isBSSExtern()) in SelectSectionForGlobal()
1465 if (Kind.isBSSLocal()) in SelectSectionForGlobal()
1473 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
1477 if (Kind.isData() || Kind.isReadOnlyWithRel()) in getSectionForConstant()
1480 if (Kind.isMergeableConst4()) in getSectionForConstant()
1482 if (Kind.isMergeableConst8()) in getSectionForConstant()
1484 if (Kind.isMergeableConst16()) in getSectionForConstant()
1729 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
1730 StringRef Name = handlePragmaClangSection(GO, Kind); in getExplicitSectionGlobal()
1739 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
1741 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getExplicitSectionGlobal()
1764 static StringRef getCOFFSectionNameForUniqueGlobal(SectionKind Kind) { in getCOFFSectionNameForUniqueGlobal() argument
1765 if (Kind.isText()) in getCOFFSectionNameForUniqueGlobal()
1767 if (Kind.isBSS()) in getCOFFSectionNameForUniqueGlobal()
1769 if (Kind.isThreadLocal()) in getCOFFSectionNameForUniqueGlobal()
1771 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in getCOFFSectionNameForUniqueGlobal()
1777 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
1781 if (Kind.isText()) in SelectSectionForGlobal()
1786 if ((EmitUniquedSection && !Kind.isCommon()) || GO->hasComdat()) { in SelectSectionForGlobal()
1787 SmallString<256> Name = getCOFFSectionNameForUniqueGlobal(Kind); in SelectSectionForGlobal()
1789 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in SelectSectionForGlobal()
1829 if (Kind.isText()) in SelectSectionForGlobal()
1832 if (Kind.isThreadLocal()) in SelectSectionForGlobal()
1835 if (Kind.isReadOnly() || Kind.isReadOnlyWithRel()) in SelectSectionForGlobal()
1841 if (Kind.isBSS() || Kind.isCommon()) in SelectSectionForGlobal()
1875 SectionKind Kind = SectionKind::getReadOnly(); in getSectionForJumpTable() local
1876 StringRef SecName = getCOFFSectionNameForUniqueGlobal(Kind); in getSectionForJumpTable()
1877 unsigned Characteristics = getCOFFSectionFlags(Kind, TM); in getSectionForJumpTable()
2135 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2137 if (Kind.isMergeableConst() && C && in getSectionForConstant()
2147 if (Kind.isMergeableConst4()) { in getSectionForConstant()
2152 } else if (Kind.isMergeableConst8()) { in getSectionForConstant()
2157 } else if (Kind.isMergeableConst16()) { in getSectionForConstant()
2163 } else if (Kind.isMergeableConst32()) { in getSectionForConstant()
2176 return TargetLoweringObjectFile::getSectionForConstant(DL, Kind, C, in getSectionForConstant()
2223 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2227 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2242 Kind = SectionKind::getMetadata(); in getExplicitSectionGlobal()
2249 unsigned Flags = getWasmSectionFlags(Kind, Used.count(GO)); in getExplicitSectionGlobal()
2250 MCSectionWasm *Section = getContext().getWasmSection(Name, Kind, Flags, Group, in getExplicitSectionGlobal()
2258 SectionKind Kind, Mangler &Mang, in selectWasmSectionForGlobal() argument
2267 SmallString<128> Name = getSectionPrefixForGlobal(Kind, /*IsLarge=*/false); in selectWasmSectionForGlobal()
2285 unsigned Flags = getWasmSectionFlags(Kind, Retain); in selectWasmSectionForGlobal()
2286 return Ctx.getWasmSection(Name, Kind, Flags, Group, UniqueID); in selectWasmSectionForGlobal()
2290 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2292 if (Kind.isCommon()) in SelectSectionForGlobal()
2298 if (Kind.isText()) in SelectSectionForGlobal()
2306 return selectWasmSectionForGlobal(getContext(), GO, Kind, getMangler(), TM, in SelectSectionForGlobal()
2417 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2427 SectionName, Kind, in getExplicitSectionGlobal()
2432 if (Kind.isText()) in getExplicitSectionGlobal()
2434 else if (Kind.isData() || Kind.isBSS()) in getExplicitSectionGlobal()
2436 else if (Kind.isReadOnlyWithRel()) in getExplicitSectionGlobal()
2439 else if (Kind.isReadOnly()) in getExplicitSectionGlobal()
2445 SectionName, Kind, XCOFF::CsectProperties(MappingClass, XCOFF::XTY_SD), in getExplicitSectionGlobal()
2482 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2491 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TD, symType), in SelectSectionForGlobal()
2499 if (Kind.isBSSLocal() || GO->hasCommonLinkage() || Kind.isThreadBSSLocal()) { in SelectSectionForGlobal()
2502 XCOFF::StorageMappingClass SMC = Kind.isBSSLocal() ? XCOFF::XMC_BS in SelectSectionForGlobal()
2503 : Kind.isCommon() ? XCOFF::XMC_RW in SelectSectionForGlobal()
2506 Name, Kind, XCOFF::CsectProperties(SMC, XCOFF::XTY_CM)); in SelectSectionForGlobal()
2509 if (Kind.isText()) { in SelectSectionForGlobal()
2517 if (TM.Options.XCOFFReadOnlyPointers && Kind.isReadOnlyWithRel()) { in SelectSectionForGlobal()
2533 if (Kind.isData() || Kind.isReadOnlyWithRel() || Kind.isBSS()) { in SelectSectionForGlobal()
2544 if (Kind.isReadOnly()) { in SelectSectionForGlobal()
2559 if (Kind.isThreadLocal()) { in SelectSectionForGlobal()
2564 Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TL, XCOFF::XTY_SD)); in SelectSectionForGlobal()
2596 const DataLayout &DL, SectionKind Kind, const Constant *C, in getSectionForConstant() argument
2785 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in getExplicitSectionGlobal() argument
2786 return SelectSectionForGlobal(GO, Kind, TM); in getExplicitSectionGlobal()
2808 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { in SelectSectionForGlobal() argument
2811 if (Kind.isBSS() || Kind.isData()) { in SelectSectionForGlobal()
2837 return getContext().getGOFFSection(Kind, Symbol->getName(), in SelectSectionForGlobal()