18 static constexpr
struct {
63 static constexpr
struct {
67 #define ENTRY(ASMNAME, ENUM) \ 68 { MachO::ENUM, StringLiteral(ASMNAME), StringLiteral(#ENUM) }, 86 :
MCSection(SV_MachO, K, Begin), TypeAndAttributes(TAA),
87 Reserved2(reserved2) {
89 "Segment or section string too long");
90 for (
unsigned i = 0; i != 16; ++i) {
91 if (i < Segment.
size())
92 SegmentName[i] = Segment[i];
96 if (i < Section.
size())
105 const MCExpr *Subsection)
const {
117 "Invalid SectionType specified!");
130 if (SectionAttrs == 0) {
134 OS <<
",none," << Reserved2;
140 char Separator =
',';
159 assert(SectionAttrs == 0 &&
"Unknown section attributes!");
163 OS <<
',' << Reserved2;
187 unsigned &StubSize) {
191 Spec.
split(SplitSpec,
',');
193 auto GetEmptyOrTrim = [&SplitSpec](
size_t Idx) ->
StringRef {
194 return SplitSpec.
size() > Idx ? SplitSpec[Idx].trim() :
StringRef();
196 Segment = GetEmptyOrTrim(0);
197 Section = GetEmptyOrTrim(1);
200 StringRef StubSizeStr = GetEmptyOrTrim(4);
203 if (Segment.
empty() || Segment.
size() > 16)
204 return "mach-o section specifier requires a segment whose length is " 205 "between 1 and 16 characters";
209 return "mach-o section specifier requires a segment and section " 210 "separated by a comma";
212 if (Section.
size() > 16)
213 return "mach-o section specifier requires a section whose length is " 214 "between 1 and 16 characters";
219 if (SectionType.
empty())
226 return SectionType == Descriptor.AssemblerName;
231 return "mach-o section specifier uses an unknown section type";
241 return "mach-o section specifier of type 'symbol_stubs' requires a size " 248 Attrs.
split(SectionAttrs,
'+', -1,
false);
250 for (
StringRef &SectionAttr : SectionAttrs) {
254 return SectionAttr.trim() == Descriptor.AssemblerName;
257 return "mach-o section specifier has invalid attribute";
259 TAA |= AttrDescriptorI->AttrFlag;
263 if (StubSizeStr.
empty()) {
266 return "mach-o section specifier of type 'symbol_stubs' requires a size " 273 return "mach-o section specifier cannot have a stub size specified because " 274 "it does not have type 'symbol_stubs'";
278 return "mach-o section specifier has a malformed stub size";
Instances of this class represent a uniqued identifier for a section in the current translation unit...
const_iterator end(StringRef path)
Get end iterator over path.
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
bool hasAttribute(unsigned Value) const
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
static constexpr struct @383 SectionAttrDescriptors[]
SectionAttrDescriptors - This is an array of descriptors for section attributes.
unsigned getTypeAndAttributes() const
S_ATTR_LOC_RELOC - Section has local relocation entries.
S_ATTR_EXT_RELOC - Section has external relocation entries.
Base class for the full range of assembler expressions which are needed for parsing.
StringRef getSectionName() const
S_ATTR_SELF_MODIFYING_CODE - Used with i386 code stubs written on by dyld.
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
#define ENTRY(ASMNAME, ENUM)
StringLiteral AssemblerName
static constexpr struct @382 SectionTypeDescriptors[MachO::LAST_KNOWN_SECTION_TYPE+1]
SectionTypeDescriptors - These are strings that describe the various section types.
LLVM_NODISCARD size_t size() const
size - Get the string size.
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
StringRef getSegmentName() const
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
This class is intended to be used as a base class for asm properties and features specific to the tar...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
static std::string ParseSectionSpecifier(StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
Parse the section specifier indicated by "Spec".
S_GB_ZEROFILL - Zero fill on demand section (that can be larger than 4 gigabytes).
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
SectionKind - This is a simple POD value that classifies the properties of a section.
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
bool UseCodeAlign() const override
Return true if a .align directive should use "optimized nops" to fill instead of 0s.
MachO::SectionType getType() const
S_ATTR_NO_DEAD_STRIP - No dead stripping.
Triple - Helper class for working with autoconf configuration names.
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
S_ATTR_SOME_INSTRUCTIONS - Section contains some machine instructions.
S_ATTR_DEBUG - A debug section.
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents...
bool isVirtualSection() const override
Check whether this section is "virtual", that is has no actual object file contents.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
S_ZEROFILL - Zero fill on demand section.
SectionType
These are the section type and attributes fields.
void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const override