33 template<
bool (DarwinAsmParser::*HandlerMethod)(StringRef, SMLoc)>
34 void addDirectiveHandler(
StringRef Directive) {
36 this, HandleDirective<DarwinAsmParser, HandlerMethod>);
37 getParser().addDirectiveHandler(Directive, Handler);
41 unsigned TAA = 0,
unsigned ImplicitAlign = 0,
42 unsigned StubSize = 0);
44 SMLoc LastVersionMinDirective;
53 addDirectiveHandler<&DarwinAsmParser::parseDirectiveAltEntry>(
".alt_entry");
54 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDesc>(
".desc");
55 addDirectiveHandler<&DarwinAsmParser::parseDirectiveIndirectSymbol>(
57 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLsym>(
".lsym");
58 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSubsectionsViaSymbols>(
59 ".subsections_via_symbols");
60 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".dump");
61 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".load");
62 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSection>(
".section");
63 addDirectiveHandler<&DarwinAsmParser::parseDirectivePushSection>(
65 addDirectiveHandler<&DarwinAsmParser::parseDirectivePopSection>(
67 addDirectiveHandler<&DarwinAsmParser::parseDirectivePrevious>(
".previous");
68 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogUnique>(
69 ".secure_log_unique");
70 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogReset>(
72 addDirectiveHandler<&DarwinAsmParser::parseDirectiveTBSS>(
".tbss");
73 addDirectiveHandler<&DarwinAsmParser::parseDirectiveZerofill>(
".zerofill");
75 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegion>(
77 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegionEnd>(
81 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveBss>(
".bss");
82 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConst>(
".const");
83 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstData>(
85 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstructor>(
87 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveCString>(
89 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveData>(
".data");
90 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDestructor>(
92 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDyld>(
".dyld");
93 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit0>(
95 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit1>(
98 &DarwinAsmParser::parseSectionDirectiveLazySymbolPointers>(
99 ".lazy_symbol_pointer");
100 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLinkerOption>(
102 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral16>(
104 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral4>(
106 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral8>(
108 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModInitFunc>(
110 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModTermFunc>(
113 &DarwinAsmParser::parseSectionDirectiveNonLazySymbolPointers>(
114 ".non_lazy_symbol_pointer");
116 &DarwinAsmParser::parseSectionDirectiveThreadLocalVariablePointers>(
117 ".thread_local_variable_pointer");
118 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatClsMeth>(
119 ".objc_cat_cls_meth");
120 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatInstMeth>(
121 ".objc_cat_inst_meth");
122 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCategory>(
124 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClass>(
126 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassNames>(
127 ".objc_class_names");
128 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassVars>(
130 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsMeth>(
132 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsRefs>(
134 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCInstMeth>(
137 &DarwinAsmParser::parseSectionDirectiveObjCInstanceVars>(
138 ".objc_instance_vars");
139 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMessageRefs>(
140 ".objc_message_refs");
141 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMetaClass>(
144 &DarwinAsmParser::parseSectionDirectiveObjCMethVarNames>(
145 ".objc_meth_var_names");
147 &DarwinAsmParser::parseSectionDirectiveObjCMethVarTypes>(
148 ".objc_meth_var_types");
149 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCModuleInfo>(
150 ".objc_module_info");
151 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCProtocol>(
154 &DarwinAsmParser::parseSectionDirectiveObjCSelectorStrs>(
155 ".objc_selector_strs");
157 &DarwinAsmParser::parseSectionDirectiveObjCStringObject>(
158 ".objc_string_object");
159 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCSymbols>(
161 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectivePICSymbolStub>(
163 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticConst>(
165 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticData>(
167 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveSymbolStub>(
169 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTData>(
".tdata");
170 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveText>(
".text");
171 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveThreadInitFunc>(
172 ".thread_init_func");
173 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTLV>(
".tlv");
175 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveIdent>(
".ident");
176 addDirectiveHandler<&DarwinAsmParser::parseVersionMin>(
177 ".watchos_version_min");
178 addDirectiveHandler<&DarwinAsmParser::parseVersionMin>(
".tvos_version_min");
179 addDirectiveHandler<&DarwinAsmParser::parseVersionMin>(
".ios_version_min");
180 addDirectiveHandler<&DarwinAsmParser::parseVersionMin>(
181 ".macosx_version_min");
183 LastVersionMinDirective =
SMLoc();
206 return parseSectionSwitch(
"__DATA",
"__bss");
210 return parseSectionSwitch(
"__TEXT",
"__const");
213 return parseSectionSwitch(
"__TEXT",
"__static_const");
216 return parseSectionSwitch(
"__TEXT",
"__cstring",
220 return parseSectionSwitch(
"__TEXT",
"__literal4",
224 return parseSectionSwitch(
"__TEXT",
"__literal8",
228 return parseSectionSwitch(
"__TEXT",
"__literal16",
232 return parseSectionSwitch(
"__TEXT",
"__constructor");
235 return parseSectionSwitch(
"__TEXT",
"__destructor");
238 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init0");
241 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init1");
244 return parseSectionSwitch(
"__TEXT",
"__symbol_stub",
251 return parseSectionSwitch(
"__TEXT",
"__picsymbol_stub",
256 return parseSectionSwitch(
"__DATA",
"__data");
259 return parseSectionSwitch(
"__DATA",
"__static_data");
261 bool parseSectionDirectiveNonLazySymbolPointers(
StringRef,
SMLoc) {
262 return parseSectionSwitch(
"__DATA",
"__nl_symbol_ptr",
266 return parseSectionSwitch(
"__DATA",
"__la_symbol_ptr",
269 bool parseSectionDirectiveThreadLocalVariablePointers(
StringRef,
SMLoc) {
270 return parseSectionSwitch(
"__DATA",
"__thread_ptr",
274 return parseSectionSwitch(
"__DATA",
"__dyld");
277 return parseSectionSwitch(
"__DATA",
"__mod_init_func",
281 return parseSectionSwitch(
"__DATA",
"__mod_term_func",
285 return parseSectionSwitch(
"__DATA",
"__const");
288 return parseSectionSwitch(
"__OBJC",
"__class",
292 return parseSectionSwitch(
"__OBJC",
"__meta_class",
296 return parseSectionSwitch(
"__OBJC",
"__cat_cls_meth",
300 return parseSectionSwitch(
"__OBJC",
"__cat_inst_meth",
304 return parseSectionSwitch(
"__OBJC",
"__protocol",
308 return parseSectionSwitch(
"__OBJC",
"__string_object",
312 return parseSectionSwitch(
"__OBJC",
"__cls_meth",
316 return parseSectionSwitch(
"__OBJC",
"__inst_meth",
320 return parseSectionSwitch(
"__OBJC",
"__cls_refs",
325 return parseSectionSwitch(
"__OBJC",
"__message_refs",
330 return parseSectionSwitch(
"__OBJC",
"__symbols",
334 return parseSectionSwitch(
"__OBJC",
"__category",
338 return parseSectionSwitch(
"__OBJC",
"__class_vars",
342 return parseSectionSwitch(
"__OBJC",
"__instance_vars",
346 return parseSectionSwitch(
"__OBJC",
"__module_info",
350 return parseSectionSwitch(
"__TEXT",
"__cstring",
354 return parseSectionSwitch(
"__TEXT",
"__cstring",
358 return parseSectionSwitch(
"__TEXT",
"__cstring",
362 return parseSectionSwitch(
"__OBJC",
"__selector_strs",
366 return parseSectionSwitch(
"__DATA",
"__thread_data",
370 return parseSectionSwitch(
"__TEXT",
"__text",
374 return parseSectionSwitch(
"__DATA",
"__thread_vars",
379 getParser().eatToEndOfStatement();
383 return parseSectionSwitch(
"__DATA",
"__thread_init",
393 unsigned TAA,
unsigned Align,
396 return TokError(
"unexpected token in section switching directive");
401 getStreamer().SwitchSection(getContext().getMachOSection(
402 Segment, Section, TAA, StubSize,
414 getStreamer().EmitValueToAlignment(Align);
423 if (getParser().parseIdentifier(Name))
424 return TokError(
"expected identifier in directive");
427 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
430 return TokError(
".alt_entry must preceed symbol definition");
433 return TokError(
"unable to emit symbol attribute");
443 if (getParser().parseIdentifier(Name))
444 return TokError(
"expected identifier in directive");
447 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
450 return TokError(
"unexpected token in '.desc' directive");
454 if (getParser().parseAbsoluteExpression(DescValue))
458 return TokError(
"unexpected token in '.desc' directive");
463 getStreamer().EmitSymbolDesc(Sym, DescValue);
470 bool DarwinAsmParser::parseDirectiveIndirectSymbol(
StringRef,
SMLoc Loc) {
472 getStreamer().getCurrentSectionOnly());
478 return Error(Loc,
"indirect symbol not in a symbol pointer or stub "
482 if (getParser().parseIdentifier(Name))
483 return TokError(
"expected identifier in .indirect_symbol directive");
485 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
489 return TokError(
"non-local symbol required in directive");
492 return TokError(
"unable to emit indirect symbol attribute for: " + Name);
495 return TokError(
"unexpected token in '.indirect_symbol' directive");
504 bool DarwinAsmParser::parseDirectiveDumpOrLoad(
StringRef Directive,
506 bool IsDump = Directive ==
".dump";
508 return TokError(
"expected string in '.dump' or '.load' directive");
513 return TokError(
"unexpected token in '.dump' or '.load' directive");
520 return Warning(IDLoc,
"ignoring directive .dump for now");
522 return Warning(IDLoc,
"ignoring directive .load for now");
527 bool DarwinAsmParser::parseDirectiveLinkerOption(
StringRef IDVal,
SMLoc) {
531 return TokError(
"expected string in '" +
Twine(IDVal) +
"' directive");
534 if (getParser().parseEscapedString(Data))
543 return TokError(
"unexpected token in '" +
Twine(IDVal) +
"' directive");
547 getStreamer().EmitLinkerOptions(Args);
555 if (getParser().parseIdentifier(Name))
556 return TokError(
"expected identifier in directive");
559 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
562 return TokError(
"unexpected token in '.lsym' directive");
566 if (getParser().parseExpression(Value))
570 return TokError(
"unexpected token in '.lsym' directive");
578 return TokError(
"directive '.lsym' is unsupported");
584 SMLoc Loc = getLexer().getLoc();
587 if (getParser().parseIdentifier(SectionName))
588 return Error(Loc,
"expected identifier after '.section' directive");
592 return TokError(
"unexpected token in '.section' directive");
599 StringRef EOL = getLexer().LexUntilEndOfStatement();
600 SectionSpec.append(EOL.
begin(), EOL.
end());
604 return TokError(
"unexpected token in '.section' directive");
612 std::string ErrorStr =
614 TAA, TAAParsed, StubSize);
616 if (!ErrorStr.empty())
617 return Error(Loc, ErrorStr);
620 Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
625 .Case(
"__textcoal_nt",
"__text")
626 .
Case(
"__const_coal",
"__const")
627 .
Case(
"__datacoal_nt",
"__data")
630 if (!Section.
equals(NonCoalSection)) {
632 size_t B = SectionVal.find(
',') + 1,
E = SectionVal.find(
',', B);
635 getParser().Warning(Loc,
"section \"" + Section +
"\" is deprecated",
637 getParser().Note(Loc,
"change section name to \"" + NonCoalSection +
643 bool isText = Segment ==
"__TEXT";
644 getStreamer().SwitchSection(getContext().getMachOSection(
645 Segment, Section, TAA, StubSize,
652 bool DarwinAsmParser::parseDirectivePushSection(
StringRef S,
SMLoc Loc) {
653 getStreamer().PushSection();
655 if (parseDirectiveSection(S, Loc)) {
656 getStreamer().PopSection();
665 bool DarwinAsmParser::parseDirectivePopSection(
StringRef,
SMLoc) {
666 if (!getStreamer().PopSection())
667 return TokError(
".popsection without corresponding .pushsection");
675 if (!PreviousSection.first)
676 return TokError(
".previous without corresponding .section");
677 getStreamer().SwitchSection(PreviousSection.first, PreviousSection.second);
683 bool DarwinAsmParser::parseDirectiveSecureLogUnique(
StringRef,
SMLoc IDLoc) {
684 StringRef LogMessage = getParser().parseStringToEndOfStatement();
686 return TokError(
"unexpected token in '.secure_log_unique' directive");
688 if (getContext().getSecureLogUsed())
689 return Error(IDLoc,
".secure_log_unique specified multiple times");
692 const char *SecureLogFile = getContext().getSecureLogFile();
694 return Error(IDLoc,
".secure_log_unique used but AS_SECURE_LOG_FILE "
695 "environment variable unset.");
701 auto NewOS = llvm::make_unique<raw_fd_ostream>(
704 return Error(IDLoc,
Twine(
"can't open secure log file: ") +
705 SecureLogFile +
" (" + EC.message() +
")");
707 getContext().setSecureLog(std::move(NewOS));
711 unsigned CurBuf = getSourceManager().FindBufferContainingLoc(IDLoc);
712 *OS << getSourceManager().getBufferInfo(CurBuf).Buffer->getBufferIdentifier()
713 <<
":" << getSourceManager().FindLineNumber(IDLoc, CurBuf) <<
":"
714 << LogMessage +
"\n";
716 getContext().setSecureLogUsed(
true);
723 bool DarwinAsmParser::parseDirectiveSecureLogReset(
StringRef,
SMLoc IDLoc) {
725 return TokError(
"unexpected token in '.secure_log_reset' directive");
729 getContext().setSecureLogUsed(
false);
736 bool DarwinAsmParser::parseDirectiveSubsectionsViaSymbols(
StringRef,
SMLoc) {
738 return TokError(
"unexpected token in '.subsections_via_symbols' directive");
750 SMLoc IDLoc = getLexer().getLoc();
752 if (getParser().parseIdentifier(Name))
753 return TokError(
"expected identifier in directive");
756 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
759 return TokError(
"unexpected token in directive");
763 SMLoc SizeLoc = getLexer().getLoc();
764 if (getParser().parseAbsoluteExpression(Size))
767 int64_t Pow2Alignment = 0;
768 SMLoc Pow2AlignmentLoc;
771 Pow2AlignmentLoc = getLexer().getLoc();
772 if (getParser().parseAbsoluteExpression(Pow2Alignment))
777 return TokError(
"unexpected token in '.tbss' directive");
782 return Error(SizeLoc,
"invalid '.tbss' directive size, can't be less than"
786 if (Pow2Alignment < 0)
787 return Error(Pow2AlignmentLoc,
"invalid '.tbss' alignment, can't be less"
791 return Error(IDLoc,
"invalid symbol redefinition");
793 getStreamer().EmitTBSSSymbol(getContext().getMachOSection(
794 "__DATA",
"__thread_bss",
797 Sym, Size, 1 << Pow2Alignment);
807 if (getParser().parseIdentifier(Segment))
808 return TokError(
"expected segment name after '.zerofill' directive");
811 return TokError(
"unexpected token in directive");
815 if (getParser().parseIdentifier(Section))
816 return TokError(
"expected section name after comma in '.zerofill' "
823 getStreamer().EmitZerofill(getContext().getMachOSection(
830 return TokError(
"unexpected token in directive");
833 SMLoc IDLoc = getLexer().getLoc();
835 if (getParser().parseIdentifier(IDStr))
836 return TokError(
"expected identifier in directive");
839 MCSymbol *Sym = getContext().getOrCreateSymbol(IDStr);
842 return TokError(
"unexpected token in directive");
846 SMLoc SizeLoc = getLexer().getLoc();
847 if (getParser().parseAbsoluteExpression(Size))
850 int64_t Pow2Alignment = 0;
851 SMLoc Pow2AlignmentLoc;
854 Pow2AlignmentLoc = getLexer().getLoc();
855 if (getParser().parseAbsoluteExpression(Pow2Alignment))
860 return TokError(
"unexpected token in '.zerofill' directive");
865 return Error(SizeLoc,
"invalid '.zerofill' directive size, can't be less "
871 if (Pow2Alignment < 0)
872 return Error(Pow2AlignmentLoc,
"invalid '.zerofill' directive alignment, "
873 "can't be less than zero");
876 return Error(IDLoc,
"invalid symbol redefinition");
881 getStreamer().EmitZerofill(getContext().getMachOSection(
884 Sym, Size, 1 << Pow2Alignment);
891 bool DarwinAsmParser::parseDirectiveDataRegion(
StringRef,
SMLoc) {
898 SMLoc Loc = getParser().getTok().getLoc();
899 if (getParser().parseIdentifier(RegionType))
900 return TokError(
"expected region type after '.data_region' directive");
907 return Error(Loc,
"unknown region type in '.data_region' directive");
916 bool DarwinAsmParser::parseDirectiveDataRegionEnd(
StringRef,
SMLoc) {
918 return TokError(
"unexpected token in '.end_data_region' directive");
928 bool DarwinAsmParser::parseVersionMin(
StringRef Directive,
SMLoc Loc) {
929 int64_t Major = 0, Minor = 0, Update = 0;
937 return TokError(
"invalid OS major version number");
938 Major = getLexer().getTok().getIntVal();
939 if (Major > 65535 || Major <= 0)
940 return TokError(
"invalid OS major version number");
943 return TokError(
"minor OS version number required, comma expected");
947 return TokError(
"invalid OS minor version number");
948 Minor = getLexer().getTok().getIntVal();
949 if (Minor > 255 || Minor < 0)
950 return TokError(
"invalid OS minor version number");
955 return TokError(
"invalid update specifier, comma expected");
958 return TokError(
"invalid OS update number");
959 Update = getLexer().getTok().getIntVal();
960 if (Update > 255 || Update < 0)
961 return TokError(
"invalid OS update number");
965 const Triple &
T = getContext().getObjectFileInfo()->getTargetTriple();
973 if (T.
getOS() != ExpectedOS)
974 Warning(Loc, Directive +
" should only be used for " +
977 if (LastVersionMinDirective.isValid()) {
978 Warning(Loc,
"overriding previous version_min directive");
979 Note(LastVersionMinDirective,
"previous definition is here");
981 LastVersionMinDirective = Loc;
992 return new DarwinAsmParser;
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Represents a range in source code.
void push_back(const T &Elt)
F_Append - When opening a file, if it already exists append to the existing file instead of returning...
static SectionKind getData()
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
This represents a section on a Mach-O system (used by Mac OS X).
const char * getPointer() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
MCAsmParserExtension * createDarwinAsmParser()
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
S_4BYTE_LITERALS - Section with 4 byte literals.
static SectionKind getBSS()
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
S_8BYTE_LITERALS - Section with 8 byte literals.
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
S_ATTR_NO_DEAD_STRIP - No dead stripping.
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
static StringRef getOSTypeName(OSType Kind)
getOSTypeName - Get the canonical name for the Kind operating system.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
A switch()-like statement whose cases are string literals.
S_LITERAL_POINTERS - Section with pointers to literals.
static std::string ParseSectionSpecifier(StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
Parse the section specifier indicated by "Spec".
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
.subsections_via_symbols (MachO)
S_THREAD_LOCAL_REGULAR - Thread local data section.
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
S_CSTRING_LITERALS - Section with literal C strings.
Triple - Helper class for working with autoconf configuration names.
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
static SectionKind getThreadBSS()
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
MachO::SectionType getType() const
bool isDefined(bool SetUsed=true) const
isDefined - Check if this symbol is defined (i.e., it has an address).
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
S_16BYTE_LITERALS - Section with only 16 byte literals.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
The file should be opened in text mode on platforms that make this distinction.
static SMLoc getFromPointer(const char *Ptr)
A raw_ostream that writes to a file descriptor.
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
std::string DirName(const std::string &FileName)
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
S_ZEROFILL - Zero fill on demand section.
Represents a location in source code.
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
SectionType
These are the section type and attributes fields.
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
static SectionKind getText()