36 #include <system_error> 46 template<
bool (DarwinAsmParser::*HandlerMethod)(StringRef, SMLoc)>
47 void addDirectiveHandler(
StringRef Directive) {
49 this, HandleDirective<DarwinAsmParser, HandlerMethod>);
50 getParser().addDirectiveHandler(Directive, Handler);
54 unsigned TAA = 0,
unsigned ImplicitAlign = 0,
55 unsigned StubSize = 0);
57 SMLoc LastVersionDirective;
60 DarwinAsmParser() =
default;
66 addDirectiveHandler<&DarwinAsmParser::parseDirectiveAltEntry>(
".alt_entry");
67 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDesc>(
".desc");
68 addDirectiveHandler<&DarwinAsmParser::parseDirectiveIndirectSymbol>(
70 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLsym>(
".lsym");
71 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSubsectionsViaSymbols>(
72 ".subsections_via_symbols");
73 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".dump");
74 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDumpOrLoad>(
".load");
75 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSection>(
".section");
76 addDirectiveHandler<&DarwinAsmParser::parseDirectivePushSection>(
78 addDirectiveHandler<&DarwinAsmParser::parseDirectivePopSection>(
80 addDirectiveHandler<&DarwinAsmParser::parseDirectivePrevious>(
".previous");
81 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogUnique>(
82 ".secure_log_unique");
83 addDirectiveHandler<&DarwinAsmParser::parseDirectiveSecureLogReset>(
85 addDirectiveHandler<&DarwinAsmParser::parseDirectiveTBSS>(
".tbss");
86 addDirectiveHandler<&DarwinAsmParser::parseDirectiveZerofill>(
".zerofill");
88 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegion>(
90 addDirectiveHandler<&DarwinAsmParser::parseDirectiveDataRegionEnd>(
94 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveBss>(
".bss");
95 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConst>(
".const");
96 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstData>(
98 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveConstructor>(
100 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveCString>(
102 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveData>(
".data");
103 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDestructor>(
105 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveDyld>(
".dyld");
106 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit0>(
108 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveFVMLibInit1>(
111 &DarwinAsmParser::parseSectionDirectiveLazySymbolPointers>(
112 ".lazy_symbol_pointer");
113 addDirectiveHandler<&DarwinAsmParser::parseDirectiveLinkerOption>(
115 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral16>(
117 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral4>(
119 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveLiteral8>(
121 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModInitFunc>(
123 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveModTermFunc>(
126 &DarwinAsmParser::parseSectionDirectiveNonLazySymbolPointers>(
127 ".non_lazy_symbol_pointer");
129 &DarwinAsmParser::parseSectionDirectiveThreadLocalVariablePointers>(
130 ".thread_local_variable_pointer");
131 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatClsMeth>(
132 ".objc_cat_cls_meth");
133 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCatInstMeth>(
134 ".objc_cat_inst_meth");
135 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCCategory>(
137 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClass>(
139 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassNames>(
140 ".objc_class_names");
141 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClassVars>(
143 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsMeth>(
145 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCClsRefs>(
147 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCInstMeth>(
150 &DarwinAsmParser::parseSectionDirectiveObjCInstanceVars>(
151 ".objc_instance_vars");
152 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMessageRefs>(
153 ".objc_message_refs");
154 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCMetaClass>(
157 &DarwinAsmParser::parseSectionDirectiveObjCMethVarNames>(
158 ".objc_meth_var_names");
160 &DarwinAsmParser::parseSectionDirectiveObjCMethVarTypes>(
161 ".objc_meth_var_types");
162 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCModuleInfo>(
163 ".objc_module_info");
164 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCProtocol>(
167 &DarwinAsmParser::parseSectionDirectiveObjCSelectorStrs>(
168 ".objc_selector_strs");
170 &DarwinAsmParser::parseSectionDirectiveObjCStringObject>(
171 ".objc_string_object");
172 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveObjCSymbols>(
174 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectivePICSymbolStub>(
176 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticConst>(
178 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveStaticData>(
180 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveSymbolStub>(
182 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTData>(
".tdata");
183 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveText>(
".text");
184 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveThreadInitFunc>(
185 ".thread_init_func");
186 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveTLV>(
".tlv");
188 addDirectiveHandler<&DarwinAsmParser::parseSectionDirectiveIdent>(
".ident");
189 addDirectiveHandler<&DarwinAsmParser::parseWatchOSVersionMin>(
190 ".watchos_version_min");
191 addDirectiveHandler<&DarwinAsmParser::parseTvOSVersionMin>(
192 ".tvos_version_min");
193 addDirectiveHandler<&DarwinAsmParser::parseIOSVersionMin>(
195 addDirectiveHandler<&DarwinAsmParser::parseMacOSXVersionMin>(
196 ".macosx_version_min");
197 addDirectiveHandler<&DarwinAsmParser::parseBuildVersion>(
".build_version");
199 LastVersionDirective =
SMLoc();
222 return parseSectionSwitch(
"__DATA",
"__bss");
226 return parseSectionSwitch(
"__TEXT",
"__const");
230 return parseSectionSwitch(
"__TEXT",
"__static_const");
234 return parseSectionSwitch(
"__TEXT",
"__cstring",
239 return parseSectionSwitch(
"__TEXT",
"__literal4",
244 return parseSectionSwitch(
"__TEXT",
"__literal8",
249 return parseSectionSwitch(
"__TEXT",
"__literal16",
254 return parseSectionSwitch(
"__TEXT",
"__constructor");
258 return parseSectionSwitch(
"__TEXT",
"__destructor");
262 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init0");
266 return parseSectionSwitch(
"__TEXT",
"__fvmlib_init1");
270 return parseSectionSwitch(
"__TEXT",
"__symbol_stub",
278 return parseSectionSwitch(
"__TEXT",
"__picsymbol_stub",
284 return parseSectionSwitch(
"__DATA",
"__data");
288 return parseSectionSwitch(
"__DATA",
"__static_data");
291 bool parseSectionDirectiveNonLazySymbolPointers(
StringRef,
SMLoc) {
292 return parseSectionSwitch(
"__DATA",
"__nl_symbol_ptr",
297 return parseSectionSwitch(
"__DATA",
"__la_symbol_ptr",
301 bool parseSectionDirectiveThreadLocalVariablePointers(
StringRef,
SMLoc) {
302 return parseSectionSwitch(
"__DATA",
"__thread_ptr",
307 return parseSectionSwitch(
"__DATA",
"__dyld");
311 return parseSectionSwitch(
"__DATA",
"__mod_init_func",
316 return parseSectionSwitch(
"__DATA",
"__mod_term_func",
321 return parseSectionSwitch(
"__DATA",
"__const");
325 return parseSectionSwitch(
"__OBJC",
"__class",
330 return parseSectionSwitch(
"__OBJC",
"__meta_class",
335 return parseSectionSwitch(
"__OBJC",
"__cat_cls_meth",
340 return parseSectionSwitch(
"__OBJC",
"__cat_inst_meth",
345 return parseSectionSwitch(
"__OBJC",
"__protocol",
350 return parseSectionSwitch(
"__OBJC",
"__string_object",
355 return parseSectionSwitch(
"__OBJC",
"__cls_meth",
360 return parseSectionSwitch(
"__OBJC",
"__inst_meth",
365 return parseSectionSwitch(
"__OBJC",
"__cls_refs",
371 return parseSectionSwitch(
"__OBJC",
"__message_refs",
377 return parseSectionSwitch(
"__OBJC",
"__symbols",
382 return parseSectionSwitch(
"__OBJC",
"__category",
387 return parseSectionSwitch(
"__OBJC",
"__class_vars",
392 return parseSectionSwitch(
"__OBJC",
"__instance_vars",
397 return parseSectionSwitch(
"__OBJC",
"__module_info",
402 return parseSectionSwitch(
"__TEXT",
"__cstring",
407 return parseSectionSwitch(
"__TEXT",
"__cstring",
412 return parseSectionSwitch(
"__TEXT",
"__cstring",
417 return parseSectionSwitch(
"__OBJC",
"__selector_strs",
422 return parseSectionSwitch(
"__DATA",
"__thread_data",
427 return parseSectionSwitch(
"__TEXT",
"__text",
432 return parseSectionSwitch(
"__DATA",
"__thread_vars",
438 getParser().eatToEndOfStatement();
443 return parseSectionSwitch(
"__DATA",
"__thread_init",
462 bool parseMajorMinorVersionComponent(
unsigned *Major,
unsigned *Minor,
463 const char *VersionName);
464 bool parseOptionalTrailingVersionComponent(
unsigned *Component,
465 const char *ComponentName);
466 bool parseVersion(
unsigned *Major,
unsigned *Minor,
unsigned *Update);
475 unsigned TAA,
unsigned Align,
478 return TokError(
"unexpected token in section switching directive");
483 getStreamer().SwitchSection(getContext().getMachOSection(
484 Segment, Section, TAA, StubSize,
496 getStreamer().EmitValueToAlignment(Align);
505 if (getParser().parseIdentifier(Name))
506 return TokError(
"expected identifier in directive");
509 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
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");
529 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
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);
552 bool 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");
567 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
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");
586 bool DarwinAsmParser::parseDirectiveDumpOrLoad(
StringRef Directive,
588 bool IsDump = Directive ==
".dump";
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");
609 bool DarwinAsmParser::parseDirectiveLinkerOption(
StringRef IDVal,
SMLoc) {
613 return TokError(
"expected string in '" +
Twine(IDVal) +
"' directive");
616 if (getParser().parseEscapedString(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");
641 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
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();
669 if (getParser().parseIdentifier(SectionName))
670 return Error(Loc,
"expected identifier after '.section' directive");
674 return TokError(
"unexpected token in '.section' directive");
681 StringRef EOL = getLexer().LexUntilEndOfStatement();
682 SectionSpec.append(EOL.
begin(), EOL.
end());
686 return TokError(
"unexpected token in '.section' directive");
693 std::string ErrorStr =
695 TAA, TAAParsed, StubSize);
697 if (!ErrorStr.empty())
698 return Error(Loc, ErrorStr);
701 Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
706 .Case(
"__textcoal_nt",
"__text")
707 .
Case(
"__const_coal",
"__const")
708 .
Case(
"__datacoal_nt",
"__data")
711 if (!Section.
equals(NonCoalSection)) {
713 size_t B = SectionVal.find(
',') + 1,
E = SectionVal.find(
',', B);
716 getParser().Warning(Loc,
"section \"" + Section +
"\" is deprecated",
718 getParser().Note(Loc,
"change section name to \"" + NonCoalSection +
724 bool isText = Segment ==
"__TEXT";
725 getStreamer().SwitchSection(getContext().getMachOSection(
726 Segment, Section, TAA, StubSize,
733 bool DarwinAsmParser::parseDirectivePushSection(
StringRef S,
SMLoc Loc) {
734 getStreamer().PushSection();
736 if (parseDirectiveSection(S, Loc)) {
737 getStreamer().PopSection();
746 bool DarwinAsmParser::parseDirectivePopSection(
StringRef,
SMLoc) {
747 if (!getStreamer().PopSection())
748 return TokError(
".popsection without corresponding .pushsection");
754 bool DarwinAsmParser::parseDirectivePrevious(
StringRef DirName,
SMLoc) {
756 if (!PreviousSection.first)
757 return TokError(
".previous without corresponding .section");
758 getStreamer().SwitchSection(PreviousSection.first, PreviousSection.second);
764 bool DarwinAsmParser::parseDirectiveSecureLogUnique(
StringRef,
SMLoc IDLoc) {
765 StringRef LogMessage = getParser().parseStringToEndOfStatement();
767 return TokError(
"unexpected token in '.secure_log_unique' directive");
769 if (getContext().getSecureLogUsed())
770 return Error(IDLoc,
".secure_log_unique specified multiple times");
773 const char *SecureLogFile = getContext().getSecureLogFile();
775 return Error(IDLoc,
".secure_log_unique used but AS_SECURE_LOG_FILE " 776 "environment variable unset.");
782 auto NewOS = llvm::make_unique<raw_fd_ostream>(
785 return Error(IDLoc,
Twine(
"can't open secure log file: ") +
786 SecureLogFile +
" (" + EC.message() +
")");
788 getContext().setSecureLog(std::move(NewOS));
792 unsigned CurBuf = getSourceManager().FindBufferContainingLoc(IDLoc);
793 *OS << getSourceManager().getBufferInfo(CurBuf).Buffer->getBufferIdentifier()
794 <<
":" << getSourceManager().FindLineNumber(IDLoc, CurBuf) <<
":" 795 << LogMessage +
"\n";
797 getContext().setSecureLogUsed(
true);
804 bool DarwinAsmParser::parseDirectiveSecureLogReset(
StringRef,
SMLoc IDLoc) {
806 return TokError(
"unexpected token in '.secure_log_reset' directive");
810 getContext().setSecureLogUsed(
false);
817 bool DarwinAsmParser::parseDirectiveSubsectionsViaSymbols(
StringRef,
SMLoc) {
819 return TokError(
"unexpected token in '.subsections_via_symbols' directive");
831 SMLoc IDLoc = getLexer().getLoc();
833 if (getParser().parseIdentifier(Name))
834 return TokError(
"expected identifier in directive");
837 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
840 return TokError(
"unexpected token in directive");
844 SMLoc SizeLoc = getLexer().getLoc();
845 if (getParser().parseAbsoluteExpression(Size))
848 int64_t Pow2Alignment = 0;
849 SMLoc Pow2AlignmentLoc;
852 Pow2AlignmentLoc = getLexer().getLoc();
853 if (getParser().parseAbsoluteExpression(Pow2Alignment))
858 return TokError(
"unexpected token in '.tbss' directive");
863 return Error(SizeLoc,
"invalid '.tbss' directive size, can't be less than" 867 if (Pow2Alignment < 0)
868 return Error(Pow2AlignmentLoc,
"invalid '.tbss' alignment, can't be less" 872 return Error(IDLoc,
"invalid symbol redefinition");
874 getStreamer().EmitTBSSSymbol(getContext().getMachOSection(
875 "__DATA",
"__thread_bss",
878 Sym, Size, 1 << Pow2Alignment);
888 if (getParser().parseIdentifier(Segment))
889 return TokError(
"expected segment name after '.zerofill' directive");
892 return TokError(
"unexpected token in directive");
896 SMLoc SectionLoc = getLexer().getLoc();
897 if (getParser().parseIdentifier(Section))
898 return TokError(
"expected section name after comma in '.zerofill' " 905 getStreamer().EmitZerofill(
908 nullptr, 0, 0, SectionLoc);
913 return TokError(
"unexpected token in directive");
916 SMLoc IDLoc = getLexer().getLoc();
918 if (getParser().parseIdentifier(IDStr))
919 return TokError(
"expected identifier in directive");
922 MCSymbol *Sym = getContext().getOrCreateSymbol(IDStr);
925 return TokError(
"unexpected token in directive");
929 SMLoc SizeLoc = getLexer().getLoc();
930 if (getParser().parseAbsoluteExpression(Size))
933 int64_t Pow2Alignment = 0;
934 SMLoc Pow2AlignmentLoc;
937 Pow2AlignmentLoc = getLexer().getLoc();
938 if (getParser().parseAbsoluteExpression(Pow2Alignment))
943 return TokError(
"unexpected token in '.zerofill' directive");
948 return Error(SizeLoc,
"invalid '.zerofill' directive size, can't be less " 954 if (Pow2Alignment < 0)
955 return Error(Pow2AlignmentLoc,
"invalid '.zerofill' directive alignment, " 956 "can't be less than zero");
959 return Error(IDLoc,
"invalid symbol redefinition");
964 getStreamer().EmitZerofill(getContext().getMachOSection(
967 Sym, Size, 1 << Pow2Alignment, SectionLoc);
974 bool DarwinAsmParser::parseDirectiveDataRegion(
StringRef,
SMLoc) {
981 SMLoc Loc = getParser().getTok().getLoc();
982 if (getParser().parseIdentifier(RegionType))
983 return TokError(
"expected region type after '.data_region' directive");
990 return Error(Loc,
"unknown region type in '.data_region' directive");
999 bool DarwinAsmParser::parseDirectiveDataRegionEnd(
StringRef,
SMLoc) {
1001 return TokError(
"unexpected token in '.end_data_region' directive");
1013 bool DarwinAsmParser::parseMajorMinorVersionComponent(
unsigned *Major,
1015 const char *VersionName) {
1018 return TokError(
Twine(
"invalid ") + VersionName +
1019 " major version number, integer expected");
1020 int64_t MajorVal = getLexer().getTok().getIntVal();
1021 if (MajorVal > 65535 || MajorVal <= 0)
1022 return TokError(
Twine(
"invalid ") + VersionName +
" major version number");
1026 return TokError(
Twine(VersionName) +
1027 " minor version number required, comma expected");
1031 return TokError(
Twine(
"invalid ") + VersionName +
1032 " minor version number, integer expected");
1033 int64_t MinorVal = getLexer().getTok().getIntVal();
1034 if (MinorVal > 255 || MinorVal < 0)
1035 return TokError(
Twine(
"invalid ") + VersionName +
" minor version number");
1042 bool DarwinAsmParser::parseOptionalTrailingVersionComponent(
1043 unsigned *Component,
const char *ComponentName) {
1047 return TokError(
Twine(
"invalid ") + ComponentName +
1048 " version number, integer expected");
1049 int64_t Val = getLexer().getTok().getIntVal();
1050 if (Val > 255 || Val < 0)
1051 return TokError(
Twine(
"invalid ") + ComponentName +
" version number");
1061 if (parseMajorMinorVersionComponent(Major, Minor,
"OS"))
1070 return TokError(
"invalid OS update specifier, comma expected");
1071 if (parseOptionalTrailingVersionComponent(Update,
"OS update"))
1076 bool DarwinAsmParser::parseSDKVersion(
VersionTuple &SDKVersion) {
1079 unsigned Major, Minor;
1080 if (parseMajorMinorVersionComponent(&Major, &Minor,
"SDK"))
1087 if (parseOptionalTrailingVersionComponent(&Subminor,
"SDK subminor"))
1096 const Triple &
Target = getContext().getObjectFileInfo()->getTargetTriple();
1097 if (Target.
getOS() != ExpectedOS)
1100 " used while targeting " + Target.
getOSName());
1102 if (LastVersionDirective.isValid()) {
1103 Warning(Loc,
"overriding previous version directive");
1104 Note(LastVersionDirective,
"previous definition is here");
1106 LastVersionDirective = Loc;
1124 bool DarwinAsmParser::parseVersionMin(
StringRef Directive,
SMLoc Loc,
1137 return addErrorSuffix(
Twine(
" in '") + Directive +
"' directive");
1140 checkVersion(Directive,
StringRef(), Loc, ExpectedOS);
1141 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");
1174 return Error(PlatformLoc,
"unknown platform name");
1177 return TokError(
"version number required, comma expected");
1191 return addErrorSuffix(
" in '.build_version' directive");
1195 checkVersion(Directive, PlatformName, Loc, ExpectedOS);
1196 getStreamer().EmitBuildVersion(Platform, Major, Minor, Update, SDKVersion);
1204 return new DarwinAsmParser;
Represents a range in source code.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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).
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.
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.
S_ATTR_NO_DEAD_STRIP - No dead stripping.
StringRef getIdentifier() const
Get the identifier string for the current token, which should be an identifier or a string...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
S_8BYTE_LITERALS - Section with 8 byte literals.
Target independent representation for an assembler token.
static bool isSDKVersionToken(const AsmToken &Tok)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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)
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.
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.
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.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
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 ...
static SMLoc getFromPointer(const char *Ptr)
amdgpu Simplify well known AMD library false Value Value * Arg
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...
LLVM Value Representation.
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()