33#include <system_error>
43 template<
bool (DarwinAsmParser::*HandlerMethod)(StringRef, SMLoc)>
46 this, HandleDirective<DarwinAsmParser, HandlerMethod>);
51 unsigned TAA = 0,
unsigned ImplicitAlign = 0,
52 unsigned StubSize = 0);
54 SMLoc LastVersionDirective;
57 DarwinAsmParser() =
default;
63 addDirectiveHandler<&DarwinAsmParser::parseDirectiveAltEntry>(
".alt_entry");
64 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDesc>(
".desc");
65 addDirectiveHandler<&DarwinAsmParser::parseDirectiveIndirectSymbol>(
67 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLsym>(
".lsym");
68 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSubsectionsViaSymbols>(
69 ".subsections_via_symbols");
70 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".dump");
71 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".load");
72 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSection>(
".section");
73 addDirectiveHandler<&DarwinAsmParser::parseDirectivePushSection>(
75 addDirectiveHandler<&DarwinAsmParser::parseDirectivePopSection>(
77 addDirectiveHandler<&DarwinAsmParser::parseDirectivePrevious>(
".previous");
78 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogUnique>(
79 ".secure_log_unique");
80 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogReset>(
82 addDirectiveHandler<&DarwinAsmParser::parseDirectiveTBSS>(
".tbss");
83 addDirectiveHandler<&DarwinAsmParser::parseDirectiveZerofill>(
".zerofill");
85 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegion>(
87 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegionEnd>(
91 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveBss>(
".bss");
92 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConst>(
".const");
93 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstData>(
95 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstructor>(
97 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveCString>(
99 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveData>(
".data");
100 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDestructor>(
102 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDyld>(
".dyld");
103 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit0>(
105 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit1>(
108 &DarwinAsmParser::parseSectionDirectiveLazySymbolPointers>(
109 ".lazy_symbol_pointer");
110 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLinkerOption>(
112 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral16>(
114 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral4>(
116 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral8>(
118 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModInitFunc>(
120 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModTermFunc>(
123 &DarwinAsmParser::parseSectionDirectiveNonLazySymbolPointers>(
124 ".non_lazy_symbol_pointer");
126 &DarwinAsmParser::parseSectionDirectiveThreadLocalVariablePointers>(
127 ".thread_local_variable_pointer");
128 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatClsMeth>(
129 ".objc_cat_cls_meth");
130 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatInstMeth>(
131 ".objc_cat_inst_meth");
132 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCategory>(
134 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClass>(
136 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassNames>(
137 ".objc_class_names");
138 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassVars>(
140 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsMeth>(
142 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsRefs>(
144 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCInstMeth>(
147 &DarwinAsmParser::parseSectionDirectiveObjCInstanceVars>(
148 ".objc_instance_vars");
149 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMessageRefs>(
150 ".objc_message_refs");
151 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMetaClass>(
154 &DarwinAsmParser::parseSectionDirectiveObjCMethVarNames>(
155 ".objc_meth_var_names");
157 &DarwinAsmParser::parseSectionDirectiveObjCMethVarTypes>(
158 ".objc_meth_var_types");
159 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCModuleInfo>(
160 ".objc_module_info");
161 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCProtocol>(
164 &DarwinAsmParser::parseSectionDirectiveObjCSelectorStrs>(
165 ".objc_selector_strs");
167 &DarwinAsmParser::parseSectionDirectiveObjCStringObject>(
168 ".objc_string_object");
169 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCSymbols>(
171 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectivePICSymbolStub>(
173 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticConst>(
175 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticData>(
177 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveSymbolStub>(
179 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTData>(
".tdata");
180 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveText>(
".text");
181 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveThreadInitFunc>(
182 ".thread_init_func");
183 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTLV>(
".tlv");
185 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveIdent>(
".ident");
186 addDirectiveHandler<&DarwinAsmParser::parseWatchOSVersionMin>(
187 ".watchos_version_min");
188 addDirectiveHandler<&DarwinAsmParser::parseTvOSVersionMin>(
189 ".tvos_version_min");
190 addDirectiveHandler<&DarwinAsmParser::parseIOSVersionMin>(
192 addDirectiveHandler<&DarwinAsmParser::parseMacOSXVersionMin>(
193 ".macosx_version_min");
194 addDirectiveHandler<&DarwinAsmParser::parseBuildVersion>(
".build_version");
195 addDirectiveHandler<&DarwinAsmParser::parseDirectiveCGProfile>(
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",
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);
475 unsigned TAA,
unsigned Alignment,
478 return TokError(
"unexpected token in section switching directive");
483 getStreamer().switchSection(getContext().getMachOSection(
484 Segment, Section, TAA, StubSize,
496 getStreamer().emitValueToAlignment(
Align(Alignment));
505 if (getParser().parseIdentifier(
Name))
506 return TokError(
"expected identifier in directive");
511 if (
Sym->isDefined())
512 return TokError(
".alt_entry must preceed symbol definition");
515 return TokError(
"unable to emit symbol attribute");
525 if (getParser().parseIdentifier(
Name))
526 return TokError(
"expected identifier in directive");
532 return TokError(
"unexpected token in '.desc' directive");
536 if (getParser().parseAbsoluteExpression(DescValue))
540 return TokError(
"unexpected token in '.desc' directive");
545 getStreamer().emitSymbolDesc(
Sym, DescValue);
552bool DarwinAsmParser::parseDirectiveIndirectSymbol(
StringRef,
SMLoc Loc) {
554 getStreamer().getCurrentSectionOnly());
560 return Error(Loc,
"indirect symbol not in a symbol pointer or stub "
564 if (getParser().parseIdentifier(
Name))
565 return TokError(
"expected identifier in .indirect_symbol directive");
570 if (
Sym->isTemporary())
571 return TokError(
"non-local symbol required in directive");
574 return TokError(
"unable to emit indirect symbol attribute for: " +
Name);
577 return TokError(
"unexpected token in '.indirect_symbol' directive");
590 return TokError(
"expected string in '.dump' or '.load' directive");
595 return TokError(
"unexpected token in '.dump' or '.load' directive");
602 return Warning(IDLoc,
"ignoring directive .dump for now");
604 return Warning(IDLoc,
"ignoring directive .load for now");
609bool DarwinAsmParser::parseDirectiveLinkerOption(
StringRef IDVal,
SMLoc) {
613 return TokError(
"expected string in '" +
Twine(IDVal) +
"' directive");
616 if (getParser().parseEscapedString(Data))
619 Args.push_back(Data);
625 return TokError(
"unexpected token in '" +
Twine(IDVal) +
"' directive");
629 getStreamer().emitLinkerOptions(Args);
637 if (getParser().parseIdentifier(
Name))
638 return TokError(
"expected identifier in directive");
644 return TokError(
"unexpected token in '.lsym' directive");
648 if (getParser().parseExpression(
Value))
652 return TokError(
"unexpected token in '.lsym' directive");
660 return TokError(
"directive '.lsym' is unsupported");
666 SMLoc Loc = getLexer().getLoc();
670 return Error(Loc,
"expected identifier after '.section' directive");
674 return TokError(
"unexpected token in '.section' directive");
676 std::string SectionSpec = std::string(
SectionName);
681 StringRef EOL = getLexer().LexUntilEndOfStatement();
682 SectionSpec.append(EOL.
begin(), EOL.
end());
686 return TokError(
"unexpected token in '.section' directive");
694 SectionSpec, Segment, Section, TAA, TAAParsed, StubSize))
698 Triple TT = getParser().getContext().getTargetTriple();
703 .
Case(
"__textcoal_nt",
"__text")
704 .
Case(
"__const_coal",
"__const")
705 .
Case(
"__datacoal_nt",
"__data")
708 if (Section != NonCoalSection) {
710 size_t B = SectionVal.find(
',') + 1, E = SectionVal.find(
',',
B);
713 getParser().Warning(Loc,
"section \"" + Section +
"\" is deprecated",
715 getParser().Note(Loc,
"change section name to \"" + NonCoalSection +
721 bool isText = Segment ==
"__TEXT";
722 getStreamer().switchSection(getContext().getMachOSection(
723 Segment, Section, TAA, StubSize,
730bool DarwinAsmParser::parseDirectivePushSection(
StringRef S,
SMLoc Loc) {
731 getStreamer().pushSection();
733 if (parseDirectiveSection(S, Loc)) {
734 getStreamer().popSection();
744 if (!getStreamer().popSection())
745 return TokError(
".popsection without corresponding .pushsection");
751bool DarwinAsmParser::parseDirectivePrevious(
StringRef DirName,
SMLoc) {
753 if (!PreviousSection.first)
754 return TokError(
".previous without corresponding .section");
755 getStreamer().switchSection(PreviousSection.first, PreviousSection.second);
761bool DarwinAsmParser::parseDirectiveSecureLogUnique(
StringRef,
SMLoc IDLoc) {
762 StringRef LogMessage = getParser().parseStringToEndOfStatement();
764 return TokError(
"unexpected token in '.secure_log_unique' directive");
766 if (getContext().getSecureLogUsed())
767 return Error(IDLoc,
".secure_log_unique specified multiple times");
770 StringRef SecureLogFile = getContext().getSecureLogFile();
771 if (SecureLogFile.
empty())
772 return Error(IDLoc,
".secure_log_unique used but AS_SECURE_LOG_FILE "
773 "environment variable unset.");
779 auto NewOS = std::make_unique<raw_fd_ostream>(
782 return Error(IDLoc,
Twine(
"can't open secure log file: ") +
783 SecureLogFile +
" (" +
EC.message() +
")");
785 getContext().setSecureLog(std::move(NewOS));
789 unsigned CurBuf = getSourceManager().FindBufferContainingLoc(IDLoc);
790 *
OS << getSourceManager().getBufferInfo(CurBuf).Buffer->getBufferIdentifier()
791 <<
":" << getSourceManager().FindLineNumber(IDLoc, CurBuf) <<
":"
792 << LogMessage +
"\n";
794 getContext().setSecureLogUsed(
true);
801bool DarwinAsmParser::parseDirectiveSecureLogReset(
StringRef,
SMLoc IDLoc) {
803 return TokError(
"unexpected token in '.secure_log_reset' directive");
807 getContext().setSecureLogUsed(
false);
814bool DarwinAsmParser::parseDirectiveSubsectionsViaSymbols(
StringRef,
SMLoc) {
816 return TokError(
"unexpected token in '.subsections_via_symbols' directive");
828 SMLoc IDLoc = getLexer().getLoc();
830 if (getParser().parseIdentifier(
Name))
831 return TokError(
"expected identifier in directive");
837 return TokError(
"unexpected token in directive");
841 SMLoc SizeLoc = getLexer().getLoc();
842 if (getParser().parseAbsoluteExpression(
Size))
845 int64_t Pow2Alignment = 0;
846 SMLoc Pow2AlignmentLoc;
849 Pow2AlignmentLoc = getLexer().getLoc();
850 if (getParser().parseAbsoluteExpression(Pow2Alignment))
855 return TokError(
"unexpected token in '.tbss' directive");
860 return Error(SizeLoc,
"invalid '.tbss' directive size, can't be less than"
864 if (Pow2Alignment < 0)
865 return Error(Pow2AlignmentLoc,
"invalid '.tbss' alignment, can't be less"
868 if (!
Sym->isUndefined())
869 return Error(IDLoc,
"invalid symbol redefinition");
871 getStreamer().emitTBSSSymbol(
872 getContext().getMachOSection(
"__DATA",
"__thread_bss",
885 if (getParser().parseIdentifier(Segment))
886 return TokError(
"expected segment name after '.zerofill' directive");
889 return TokError(
"unexpected token in directive");
893 SMLoc SectionLoc = getLexer().getLoc();
894 if (getParser().parseIdentifier(Section))
895 return TokError(
"expected section name after comma in '.zerofill' "
902 getStreamer().emitZerofill(
905 nullptr, 0,
Align(1), SectionLoc);
910 return TokError(
"unexpected token in directive");
913 SMLoc IDLoc = getLexer().getLoc();
915 if (getParser().parseIdentifier(IDStr))
916 return TokError(
"expected identifier in directive");
919 MCSymbol *
Sym = getContext().getOrCreateSymbol(IDStr);
922 return TokError(
"unexpected token in directive");
926 SMLoc SizeLoc = getLexer().getLoc();
927 if (getParser().parseAbsoluteExpression(
Size))
930 int64_t Pow2Alignment = 0;
931 SMLoc Pow2AlignmentLoc;
934 Pow2AlignmentLoc = getLexer().getLoc();
935 if (getParser().parseAbsoluteExpression(Pow2Alignment))
940 return TokError(
"unexpected token in '.zerofill' directive");
945 return Error(SizeLoc,
"invalid '.zerofill' directive size, can't be less "
951 if (Pow2Alignment < 0)
952 return Error(Pow2AlignmentLoc,
"invalid '.zerofill' directive alignment, "
953 "can't be less than zero");
955 if (!
Sym->isUndefined())
956 return Error(IDLoc,
"invalid symbol redefinition");
961 getStreamer().emitZerofill(
978 SMLoc Loc = getParser().getTok().getLoc();
979 if (getParser().parseIdentifier(RegionType))
980 return TokError(
"expected region type after '.data_region' directive");
987 return Error(Loc,
"unknown region type in '.data_region' directive");
996bool DarwinAsmParser::parseDirectiveDataRegionEnd(
StringRef,
SMLoc) {
998 return TokError(
"unexpected token in '.end_data_region' directive");
1010bool DarwinAsmParser::parseMajorMinorVersionComponent(
unsigned *Major,
1012 const char *VersionName) {
1015 return TokError(
Twine(
"invalid ") + VersionName +
1016 " major version number, integer expected");
1017 int64_t MajorVal = getLexer().getTok().getIntVal();
1018 if (MajorVal > 65535 || MajorVal <= 0)
1019 return TokError(
Twine(
"invalid ") + VersionName +
" major version number");
1023 return TokError(
Twine(VersionName) +
1024 " minor version number required, comma expected");
1028 return TokError(
Twine(
"invalid ") + VersionName +
1029 " minor version number, integer expected");
1030 int64_t MinorVal = getLexer().getTok().getIntVal();
1031 if (MinorVal > 255 || MinorVal < 0)
1032 return TokError(
Twine(
"invalid ") + VersionName +
" minor version number");
1039bool DarwinAsmParser::parseOptionalTrailingVersionComponent(
1040 unsigned *Component,
const char *ComponentName) {
1044 return TokError(
Twine(
"invalid ") + ComponentName +
1045 " version number, integer expected");
1046 int64_t Val = getLexer().getTok().getIntVal();
1047 if (Val > 255 || Val < 0)
1048 return TokError(
Twine(
"invalid ") + ComponentName +
" version number");
1056bool DarwinAsmParser::parseVersion(
unsigned *Major,
unsigned *Minor,
1058 if (parseMajorMinorVersionComponent(Major, Minor,
"OS"))
1067 return TokError(
"invalid OS update specifier, comma expected");
1068 if (parseOptionalTrailingVersionComponent(Update,
"OS update"))
1073bool DarwinAsmParser::parseSDKVersion(
VersionTuple &SDKVersion) {
1076 unsigned Major, Minor;
1077 if (parseMajorMinorVersionComponent(&Major, &Minor,
"SDK"))
1084 if (parseOptionalTrailingVersionComponent(&Subminor,
"SDK subminor"))
1094 if (
Target.getOS() != ExpectedOS)
1097 " used while targeting " +
Target.getOSName());
1099 if (LastVersionDirective.isValid()) {
1100 Warning(Loc,
"overriding previous version directive");
1101 Note(LastVersionDirective,
"previous definition is here");
1103 LastVersionDirective = Loc;
1134 return addErrorSuffix(
Twine(
" in '") +
Directive +
"' directive");
1138 getStreamer().emitVersionMin(
Type, Major, Minor, Update, SDKVersion);
1144 case MachO::PLATFORM_UNKNOWN:
1151 case MachO::PLATFORM_BRIDGEOS:
break;
1152 case MachO::PLATFORM_DRIVERKIT:
1154 case MachO::PLATFORM_MACCATALYST:
return Triple::IOS;
1155 case MachO::PLATFORM_IOSSIMULATOR:
break;
1156 case MachO::PLATFORM_TVOSSIMULATOR:
break;
1157 case MachO::PLATFORM_WATCHOSSIMULATOR:
break;
1158 case MachO::PLATFORM_XROS_SIMULATOR:
break;
1167 SMLoc PlatformLoc = getTok().getLoc();
1168 if (getParser().parseIdentifier(PlatformName))
1169 return TokError(
"platform name expected");
1172#define PLATFORM(platform, id, name, build_name, target, tapi_target, \
1174 .Case(#build_name, MachO::PLATFORM_##platform)
1175#include "llvm/BinaryFormat/MachO.def"
1176 .
Default(MachO::PLATFORM_UNKNOWN);
1178 if (Platform == MachO::PLATFORM_UNKNOWN)
1179 return Error(PlatformLoc,
"unknown platform name");
1182 return TokError(
"version number required, comma expected");
1196 return addErrorSuffix(
" in '.build_version' directive");
1200 checkVersion(
Directive, PlatformName, Loc, ExpectedOS);
1201 getStreamer().emitBuildVersion(Platform, Major, Minor, Update, SDKVersion);
1207bool DarwinAsmParser::parseDirectiveCGProfile(
StringRef S,
SMLoc Loc) {
1214 return new DarwinAsmParser;
static bool isNot(const MachineRegisterInfo &MRI, const MachineInstr &MI)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static Version parseVersion(StringRef Name)
static bool isSDKVersionToken(const AsmToken &Tok)
static Triple::OSType getOSTypeFromMCVM(MCVersionMinType Type)
static Triple::OSType getOSTypeFromPlatform(MachO::PlatformType Type)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Target independent representation for an assembler token.
bool is(TokenKind K) const
StringRef getIdentifier() const
Get the identifier string for the current token, which should be an identifier or a string.
Lightweight error class with error context and mandatory checking.
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
bool ParseDirectiveCGProfile(StringRef, SMLoc)
ParseDirectiveCGProfile ::= .cg_profile identifier, identifier, <number>
MCAsmParser & getParser()
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
virtual void addDirectiveHandler(StringRef Directive, ExtensionDirectiveHandler Handler)=0
Base class for the full range of assembler expressions which are needed for parsing.
This represents a section on a Mach-O system (used by Mac OS X).
static Error ParseSectionSpecifier(StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
Parse the section specifier indicated by "Spec".
MachO::SectionType getType() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Represents a location in source code.
static SMLoc getFromPointer(const char *Ptr)
constexpr const char * getPointer() const
Represents a range in source code.
static SectionKind getText()
static SectionKind getData()
static SectionKind getBSS()
static SectionKind getThreadBSS()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
A raw_ostream that writes to a file descriptor.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ S_ATTR_NO_DEAD_STRIP
S_ATTR_NO_DEAD_STRIP - No dead stripping.
@ S_ATTR_PURE_INSTRUCTIONS
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
SectionType
These are the section type and attributes fields.
@ S_THREAD_LOCAL_VARIABLE_POINTERS
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
@ S_16BYTE_LITERALS
S_16BYTE_LITERALS - Section with only 16 byte literals.
@ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
@ S_THREAD_LOCAL_ZEROFILL
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
@ S_LAZY_SYMBOL_POINTERS
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
@ S_MOD_TERM_FUNC_POINTERS
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
@ S_MOD_INIT_FUNC_POINTERS
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
@ S_CSTRING_LITERALS
S_CSTRING_LITERALS - Section with literal C strings.
@ S_THREAD_LOCAL_REGULAR
S_THREAD_LOCAL_REGULAR - Thread local data section.
@ S_ZEROFILL
S_ZEROFILL - Zero fill on demand section.
@ S_NON_LAZY_SYMBOL_POINTERS
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
@ S_4BYTE_LITERALS
S_4BYTE_LITERALS - Section with 4 byte literals.
@ S_LITERAL_POINTERS
S_LITERAL_POINTERS - Section with pointers to literals.
@ S_8BYTE_LITERALS
S_8BYTE_LITERALS - Section with 8 byte literals.
@ S_THREAD_LOCAL_VARIABLES
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
@ S_SYMBOL_STUBS
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
@ OF_Append
The file should be opened in append mode.
This is an optimization pass for GlobalISel generic memory operations.
@ MCDR_DataRegionEnd
.end_data_region
@ MCDR_DataRegion
.data_region
@ MCDR_DataRegionJT8
.data_region jt8
@ MCDR_DataRegionJT32
.data_region jt32
@ MCDR_DataRegionJT16
.data_region jt16
std::pair< MCSection *, uint32_t > MCSectionSubPair
@ MCVM_WatchOSVersionMin
.watchos_version_min
@ MCVM_OSXVersionMin
.macosx_version_min
@ MCVM_TvOSVersionMin
.tvos_version_min
@ MCVM_IOSVersionMin
.ios_version_min
@ MCAF_SubsectionsViaSymbols
.subsections_via_symbols (MachO)
MCAsmParserExtension * createDarwinAsmParser()
@ MCSA_AltEntry
.alt_entry (MachO)
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
This struct is a compact representation of a valid (non-zero power of two) alignment.