35 #include <system_error> 45 template<
bool (DarwinAsmParser::*HandlerMethod)(StringRef, SMLoc)>
48 this, HandleDirective<DarwinAsmParser, HandlerMethod>);
49 getParser().addDirectiveHandler(Directive, Handler);
53 unsigned TAA = 0,
unsigned ImplicitAlign = 0,
54 unsigned StubSize = 0);
56 SMLoc LastVersionDirective;
59 DarwinAsmParser() =
default;
65 addDirectiveHandler<&DarwinAsmParser::parseDirectiveAltEntry>(
".alt_entry");
66 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDesc>(
".desc");
67 addDirectiveHandler<&DarwinAsmParser::parseDirectiveIndirectSymbol>(
69 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLsym>(
".lsym");
70 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSubsectionsViaSymbols>(
71 ".subsections_via_symbols");
72 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".dump");
73 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".load");
74 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSection>(
".section");
75 addDirectiveHandler<&DarwinAsmParser::parseDirectivePushSection>(
77 addDirectiveHandler<&DarwinAsmParser::parseDirectivePopSection>(
79 addDirectiveHandler<&DarwinAsmParser::parseDirectivePrevious>(
".previous");
80 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogUnique>(
81 ".secure_log_unique");
82 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogReset>(
84 addDirectiveHandler<&DarwinAsmParser::parseDirectiveTBSS>(
".tbss");
85 addDirectiveHandler<&DarwinAsmParser::parseDirectiveZerofill>(
".zerofill");
87 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegion>(
89 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegionEnd>(
93 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveBss>(
".bss");
94 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConst>(
".const");
95 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstData>(
97 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstructor>(
99 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveCString>(
101 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveData>(
".data");
102 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDestructor>(
104 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDyld>(
".dyld");
105 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit0>(
107 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit1>(
110 &DarwinAsmParser::parseSectionDirectiveLazySymbolPointers>(
111 ".lazy_symbol_pointer");
112 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLinkerOption>(
114 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral16>(
116 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral4>(
118 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral8>(
120 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModInitFunc>(
122 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModTermFunc>(
125 &DarwinAsmParser::parseSectionDirectiveNonLazySymbolPointers>(
126 ".non_lazy_symbol_pointer");
128 &DarwinAsmParser::parseSectionDirectiveThreadLocalVariablePointers>(
129 ".thread_local_variable_pointer");
130 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatClsMeth>(
131 ".objc_cat_cls_meth");
132 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatInstMeth>(
133 ".objc_cat_inst_meth");
134 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCategory>(
136 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClass>(
138 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassNames>(
139 ".objc_class_names");
140 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassVars>(
142 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsMeth>(
144 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsRefs>(
146 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCInstMeth>(
149 &DarwinAsmParser::parseSectionDirectiveObjCInstanceVars>(
150 ".objc_instance_vars");
151 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMessageRefs>(
152 ".objc_message_refs");
153 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMetaClass>(
156 &DarwinAsmParser::parseSectionDirectiveObjCMethVarNames>(
157 ".objc_meth_var_names");
159 &DarwinAsmParser::parseSectionDirectiveObjCMethVarTypes>(
160 ".objc_meth_var_types");
161 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCModuleInfo>(
162 ".objc_module_info");
163 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCProtocol>(
166 &DarwinAsmParser::parseSectionDirectiveObjCSelectorStrs>(
167 ".objc_selector_strs");
169 &DarwinAsmParser::parseSectionDirectiveObjCStringObject>(
170 ".objc_string_object");
171 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCSymbols>(
173 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectivePICSymbolStub>(
175 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticConst>(
177 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticData>(
179 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveSymbolStub>(
181 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTData>(
".tdata");
182 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveText>(
".text");
183 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveThreadInitFunc>(
184 ".thread_init_func");
185 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTLV>(
".tlv");
187 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveIdent>(
".ident");
188 addDirectiveHandler<&DarwinAsmParser::parseWatchOSVersionMin>(
189 ".watchos_version_min");
190 addDirectiveHandler<&DarwinAsmParser::parseTvOSVersionMin>(
191 ".tvos_version_min");
192 addDirectiveHandler<&DarwinAsmParser::parseIOSVersionMin>(
194 addDirectiveHandler<&DarwinAsmParser::parseMacOSXVersionMin>(
195 ".macosx_version_min");
196 addDirectiveHandler<&DarwinAsmParser::parseBuildVersion>(
".build_version");
198 LastVersionDirective =
SMLoc();
221 return parseSectionSwitch(
"__DATA",
"__bss");
225 return parseSectionSwitch(
"__TEXT",
"__const");
229 return parseSectionSwitch(
"__TEXT",
"__static_const");
233 return parseSectionSwitch(
"__TEXT",
"__cstring",
238 return parseSectionSwitch(
"__TEXT",
"__literal4",
243 return parseSectionSwitch(
"__TEXT",
"__literal8",
248 return parseSectionSwitch(
"__TEXT",
"__literal16",
253 return parseSectionSwitch(
"__TEXT",
"__constructor");
257 return parseSectionSwitch(
"__TEXT",
"__destructor");
261 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init0");
265 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init1");
269 return parseSectionSwitch(
"__TEXT",
"__symbol_stub",
277 return parseSectionSwitch(
"__TEXT",
"__picsymbol_stub",
283 return parseSectionSwitch(
"__DATA",
"__data");
287 return parseSectionSwitch(
"__DATA",
"__static_data");
290 bool parseSectionDirectiveNonLazySymbolPointers(
StringRef,
SMLoc) {
291 return parseSectionSwitch(
"__DATA",
"__nl_symbol_ptr",
296 return parseSectionSwitch(
"__DATA",
"__la_symbol_ptr",
300 bool parseSectionDirectiveThreadLocalVariablePointers(
StringRef,
SMLoc) {
301 return parseSectionSwitch(
"__DATA",
"__thread_ptr",
306 return parseSectionSwitch(
"__DATA",
"__dyld");
310 return parseSectionSwitch(
"__DATA",
"__mod_init_func",
315 return parseSectionSwitch(
"__DATA",
"__mod_term_func",
320 return parseSectionSwitch(
"__DATA",
"__const");
324 return parseSectionSwitch(
"__OBJC",
"__class",
329 return parseSectionSwitch(
"__OBJC",
"__meta_class",
334 return parseSectionSwitch(
"__OBJC",
"__cat_cls_meth",
339 return parseSectionSwitch(
"__OBJC",
"__cat_inst_meth",
344 return parseSectionSwitch(
"__OBJC",
"__protocol",
349 return parseSectionSwitch(
"__OBJC",
"__string_object",
354 return parseSectionSwitch(
"__OBJC",
"__cls_meth",
359 return parseSectionSwitch(
"__OBJC",
"__inst_meth",
364 return parseSectionSwitch(
"__OBJC",
"__cls_refs",
370 return parseSectionSwitch(
"__OBJC",
"__message_refs",
376 return parseSectionSwitch(
"__OBJC",
"__symbols",
381 return parseSectionSwitch(
"__OBJC",
"__category",
386 return parseSectionSwitch(
"__OBJC",
"__class_vars",
391 return parseSectionSwitch(
"__OBJC",
"__instance_vars",
396 return parseSectionSwitch(
"__OBJC",
"__module_info",
401 return parseSectionSwitch(
"__TEXT",
"__cstring",
406 return parseSectionSwitch(
"__TEXT",
"__cstring",
411 return parseSectionSwitch(
"__TEXT",
"__cstring",
416 return parseSectionSwitch(
"__OBJC",
"__selector_strs",
421 return parseSectionSwitch(
"__DATA",
"__thread_data",
426 return parseSectionSwitch(
"__TEXT",
"__text",
431 return parseSectionSwitch(
"__DATA",
"__thread_vars",
437 getParser().eatToEndOfStatement();
442 return parseSectionSwitch(
"__DATA",
"__thread_init",
461 bool parseMajorMinorVersionComponent(
unsigned *Major,
unsigned *Minor,
462 const char *VersionName);
463 bool parseOptionalTrailingVersionComponent(
unsigned *Component,
464 const char *ComponentName);
465 bool parseVersion(
unsigned *Major,
unsigned *Minor,
unsigned *Update);
474 unsigned TAA,
unsigned Align,
477 return TokError(
"unexpected token in section switching directive");
482 getStreamer().SwitchSection(getContext().getMachOSection(
483 Segment, Section, TAA, StubSize,
495 getStreamer().EmitValueToAlignment(Align);
504 if (getParser().parseIdentifier(Name))
505 return TokError(
"expected identifier in directive");
508 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
511 return TokError(
".alt_entry must preceed symbol definition");
514 return TokError(
"unable to emit symbol attribute");
524 if (getParser().parseIdentifier(Name))
525 return TokError(
"expected identifier in directive");
528 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
531 return TokError(
"unexpected token in '.desc' directive");
535 if (getParser().parseAbsoluteExpression(DescValue))
539 return TokError(
"unexpected token in '.desc' directive");
544 getStreamer().EmitSymbolDesc(Sym, DescValue);
551 bool DarwinAsmParser::parseDirectiveIndirectSymbol(
StringRef,
SMLoc Loc) {
553 getStreamer().getCurrentSectionOnly());
559 return Error(Loc,
"indirect symbol not in a symbol pointer or stub " 563 if (getParser().parseIdentifier(Name))
564 return TokError(
"expected identifier in .indirect_symbol directive");
566 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
570 return TokError(
"non-local symbol required in directive");
573 return TokError(
"unable to emit indirect symbol attribute for: " + Name);
576 return TokError(
"unexpected token in '.indirect_symbol' directive");
587 bool IsDump = Directive ==
".dump";
589 return TokError(
"expected string in '.dump' or '.load' directive");
594 return TokError(
"unexpected token in '.dump' or '.load' directive");
601 return Warning(IDLoc,
"ignoring directive .dump for now");
603 return Warning(IDLoc,
"ignoring directive .load for now");
608 bool DarwinAsmParser::parseDirectiveLinkerOption(
StringRef IDVal,
SMLoc) {
612 return TokError(
"expected string in '" +
Twine(IDVal) +
"' directive");
615 if (getParser().parseEscapedString(Data))
624 return TokError(
"unexpected token in '" +
Twine(IDVal) +
"' directive");
628 getStreamer().EmitLinkerOptions(Args);
636 if (getParser().parseIdentifier(Name))
637 return TokError(
"expected identifier in directive");
640 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
643 return TokError(
"unexpected token in '.lsym' directive");
647 if (getParser().parseExpression(Value))
651 return TokError(
"unexpected token in '.lsym' directive");
659 return TokError(
"directive '.lsym' is unsupported");
665 SMLoc Loc = getLexer().getLoc();
668 if (getParser().parseIdentifier(SectionName))
669 return Error(Loc,
"expected identifier after '.section' directive");
673 return TokError(
"unexpected token in '.section' directive");
680 StringRef EOL = getLexer().LexUntilEndOfStatement();
681 SectionSpec.append(EOL.
begin(), EOL.
end());
685 return TokError(
"unexpected token in '.section' directive");
692 std::string ErrorStr =
694 TAA, TAAParsed, StubSize);
696 if (!ErrorStr.empty())
697 return Error(Loc, ErrorStr);
700 Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
705 .Case(
"__textcoal_nt",
"__text")
706 .
Case(
"__const_coal",
"__const")
707 .
Case(
"__datacoal_nt",
"__data")
710 if (!Section.
equals(NonCoalSection)) {
712 size_t B = SectionVal.find(
',') + 1,
E = SectionVal.find(
',', B);
715 getParser().Warning(Loc,
"section \"" + Section +
"\" is deprecated",
717 getParser().Note(Loc,
"change section name to \"" + NonCoalSection +
723 bool isText = Segment ==
"__TEXT";
724 getStreamer().SwitchSection(getContext().getMachOSection(
725 Segment, Section, TAA, StubSize,
732 bool DarwinAsmParser::parseDirectivePushSection(
StringRef S,
SMLoc Loc) {
733 getStreamer().PushSection();
735 if (parseDirectiveSection(S, Loc)) {
736 getStreamer().PopSection();
745 bool DarwinAsmParser::parseDirectivePopSection(
StringRef,
SMLoc) {
746 if (!getStreamer().PopSection())
747 return TokError(
".popsection without corresponding .pushsection");
753 bool DarwinAsmParser::parseDirectivePrevious(
StringRef DirName,
SMLoc) {
755 if (!PreviousSection.first)
756 return TokError(
".previous without corresponding .section");
757 getStreamer().SwitchSection(PreviousSection.first, PreviousSection.second);
763 bool DarwinAsmParser::parseDirectiveSecureLogUnique(
StringRef,
SMLoc IDLoc) {
764 StringRef LogMessage = getParser().parseStringToEndOfStatement();
766 return TokError(
"unexpected token in '.secure_log_unique' directive");
768 if (getContext().getSecureLogUsed())
769 return Error(IDLoc,
".secure_log_unique specified multiple times");
772 const char *SecureLogFile = getContext().getSecureLogFile();
774 return Error(IDLoc,
".secure_log_unique used but AS_SECURE_LOG_FILE " 775 "environment variable unset.");
781 auto NewOS = std::make_unique<raw_fd_ostream>(
784 return Error(IDLoc,
Twine(
"can't open secure log file: ") +
785 SecureLogFile +
" (" + EC.message() +
")");
787 getContext().setSecureLog(std::move(NewOS));
791 unsigned CurBuf = getSourceManager().FindBufferContainingLoc(IDLoc);
792 *OS << getSourceManager().getBufferInfo(CurBuf).Buffer->getBufferIdentifier()
793 <<
":" << getSourceManager().FindLineNumber(IDLoc, CurBuf) <<
":" 794 << LogMessage +
"\n";
796 getContext().setSecureLogUsed(
true);
803 bool DarwinAsmParser::parseDirectiveSecureLogReset(
StringRef,
SMLoc IDLoc) {
805 return TokError(
"unexpected token in '.secure_log_reset' directive");
809 getContext().setSecureLogUsed(
false);
816 bool DarwinAsmParser::parseDirectiveSubsectionsViaSymbols(
StringRef,
SMLoc) {
818 return TokError(
"unexpected token in '.subsections_via_symbols' directive");
830 SMLoc IDLoc = getLexer().getLoc();
832 if (getParser().parseIdentifier(Name))
833 return TokError(
"expected identifier in directive");
836 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
839 return TokError(
"unexpected token in directive");
843 SMLoc SizeLoc = getLexer().getLoc();
844 if (getParser().parseAbsoluteExpression(Size))
847 int64_t Pow2Alignment = 0;
848 SMLoc Pow2AlignmentLoc;
851 Pow2AlignmentLoc = getLexer().getLoc();
852 if (getParser().parseAbsoluteExpression(Pow2Alignment))
857 return TokError(
"unexpected token in '.tbss' directive");
862 return Error(SizeLoc,
"invalid '.tbss' directive size, can't be less than" 866 if (Pow2Alignment < 0)
867 return Error(Pow2AlignmentLoc,
"invalid '.tbss' alignment, can't be less" 871 return Error(IDLoc,
"invalid symbol redefinition");
873 getStreamer().EmitTBSSSymbol(getContext().getMachOSection(
874 "__DATA",
"__thread_bss",
877 Sym, Size, 1 << Pow2Alignment);
887 if (getParser().parseIdentifier(Segment))
888 return TokError(
"expected segment name after '.zerofill' directive");
891 return TokError(
"unexpected token in directive");
895 SMLoc SectionLoc = getLexer().getLoc();
896 if (getParser().parseIdentifier(Section))
897 return TokError(
"expected section name after comma in '.zerofill' " 904 getStreamer().EmitZerofill(
907 nullptr, 0, 0, SectionLoc);
912 return TokError(
"unexpected token in directive");
915 SMLoc IDLoc = getLexer().getLoc();
917 if (getParser().parseIdentifier(IDStr))
918 return TokError(
"expected identifier in directive");
921 MCSymbol *Sym = getContext().getOrCreateSymbol(IDStr);
924 return TokError(
"unexpected token in directive");
928 SMLoc SizeLoc = getLexer().getLoc();
929 if (getParser().parseAbsoluteExpression(Size))
932 int64_t Pow2Alignment = 0;
933 SMLoc Pow2AlignmentLoc;
936 Pow2AlignmentLoc = getLexer().getLoc();
937 if (getParser().parseAbsoluteExpression(Pow2Alignment))
942 return TokError(
"unexpected token in '.zerofill' directive");
947 return Error(SizeLoc,
"invalid '.zerofill' directive size, can't be less " 953 if (Pow2Alignment < 0)
954 return Error(Pow2AlignmentLoc,
"invalid '.zerofill' directive alignment, " 955 "can't be less than zero");
958 return Error(IDLoc,
"invalid symbol redefinition");
963 getStreamer().EmitZerofill(getContext().getMachOSection(
966 Sym, Size, 1 << Pow2Alignment, SectionLoc);
973 bool DarwinAsmParser::parseDirectiveDataRegion(
StringRef,
SMLoc) {
980 SMLoc Loc = getParser().getTok().getLoc();
981 if (getParser().parseIdentifier(RegionType))
982 return TokError(
"expected region type after '.data_region' directive");
989 return Error(Loc,
"unknown region type in '.data_region' directive");
998 bool DarwinAsmParser::parseDirectiveDataRegionEnd(
StringRef,
SMLoc) {
1000 return TokError(
"unexpected token in '.end_data_region' directive");
1012 bool DarwinAsmParser::parseMajorMinorVersionComponent(
unsigned *Major,
1014 const char *VersionName) {
1017 return TokError(
Twine(
"invalid ") + VersionName +
1018 " major version number, integer expected");
1019 int64_t MajorVal = getLexer().getTok().getIntVal();
1020 if (MajorVal > 65535 || MajorVal <= 0)
1021 return TokError(
Twine(
"invalid ") + VersionName +
" major version number");
1025 return TokError(
Twine(VersionName) +
1026 " minor version number required, comma expected");
1030 return TokError(
Twine(
"invalid ") + VersionName +
1031 " minor version number, integer expected");
1032 int64_t MinorVal = getLexer().getTok().getIntVal();
1033 if (MinorVal > 255 || MinorVal < 0)
1034 return TokError(
Twine(
"invalid ") + VersionName +
" minor version number");
1041 bool DarwinAsmParser::parseOptionalTrailingVersionComponent(
1042 unsigned *Component,
const char *ComponentName) {
1046 return TokError(
Twine(
"invalid ") + ComponentName +
1047 " version number, integer expected");
1048 int64_t Val = getLexer().getTok().getIntVal();
1049 if (Val > 255 || Val < 0)
1050 return TokError(
Twine(
"invalid ") + ComponentName +
" version number");
1060 if (parseMajorMinorVersionComponent(Major, Minor,
"OS"))
1069 return TokError(
"invalid OS update specifier, comma expected");
1070 if (parseOptionalTrailingVersionComponent(Update,
"OS update"))
1075 bool DarwinAsmParser::parseSDKVersion(
VersionTuple &SDKVersion) {
1078 unsigned Major, Minor;
1079 if (parseMajorMinorVersionComponent(&Major, &Minor,
"SDK"))
1086 if (parseOptionalTrailingVersionComponent(&Subminor,
"SDK subminor"))
1095 const Triple &
Target = getContext().getObjectFileInfo()->getTargetTriple();
1096 if (Target.
getOS() != ExpectedOS)
1099 " used while targeting " + Target.
getOSName());
1101 if (LastVersionDirective.isValid()) {
1102 Warning(Loc,
"overriding previous version directive");
1103 Note(LastVersionDirective,
"previous definition is here");
1105 LastVersionDirective = Loc;
1123 bool DarwinAsmParser::parseVersionMin(
StringRef Directive,
SMLoc Loc,
1136 return addErrorSuffix(
Twine(
" in '") + Directive +
"' directive");
1139 checkVersion(Directive,
StringRef(), Loc, ExpectedOS);
1140 getStreamer().EmitVersionMin(Type, Major, Minor, Update, SDKVersion);
1161 bool DarwinAsmParser::parseBuildVersion(
StringRef Directive,
SMLoc Loc) {
1163 SMLoc PlatformLoc = getTok().getLoc();
1164 if (getParser().parseIdentifier(PlatformName))
1165 return TokError(
"platform name expected");
1175 return Error(PlatformLoc,
"unknown platform name");
1178 return TokError(
"version number required, comma expected");
1192 return addErrorSuffix(
" in '.build_version' directive");
1196 checkVersion(Directive, PlatformName, Loc, ExpectedOS);
1197 getStreamer().EmitBuildVersion(Platform, Major, Minor, Update, SDKVersion);
1205 return new DarwinAsmParser;
Represents a range in source code.
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).
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
This class represents lattice values for constants.
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.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
void push_back(const T &Elt)
MCAsmParserExtension * createDarwinAsmParser()
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
StringSwitch & Case(StringLiteral S, T Value)
StringRef getIdentifier() const
Get the identifier string for the current token, which should be an identifier or a string...
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_NODISCARD R Default(T Value)
S_8BYTE_LITERALS - Section with 8 byte literals.
Target independent representation for an assembler token.
static bool isSDKVersionToken(const AsmToken &Tok)
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Directive
IDs for all OpenMP directives.
The file should be opened in text mode on platforms that make this distinction.
const char * getPointer() const
A switch()-like statement whose cases are string literals.
S_LITERAL_POINTERS - Section with pointers to literals.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static std::string ParseSectionSpecifier(StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
Parse the section specifier indicated by "Spec".
The instances of the Type class are immutable: once they are created, they are never changed...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
static Triple::OSType getOSTypeFromPlatform(MachO::PlatformType Type)
.subsections_via_symbols (MachO)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
S_THREAD_LOCAL_REGULAR - Thread local data section.
S_CSTRING_LITERALS - Section with literal C strings.
MachO::SectionType getType() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
S_ATTR_NO_DEAD_STRIP - No dead stripping.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Triple - Helper class for working with autoconf configuration names.
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
static SectionKind getThreadBSS()
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
StringRef getOSName() const
getOSName - Get the operating system (third) component of the triple.
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
The file should be opened in append mode.
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
S_16BYTE_LITERALS - Section with only 16 byte literals.
bool is(TokenKind K) const
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Target - Wrapper for Target specific information.
static SMLoc getFromPointer(const char *Ptr)
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Represents a version number in the form major[.minor[.subminor[.build]]].
A raw_ostream that writes to a file descriptor.
static Version parseVersion(StringRef Name)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
static Triple::OSType getOSTypeFromMCVM(MCVersionMinType Type)
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
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.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
static SectionKind getText()