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 parseVersion(
unsigned *Major,
unsigned *Minor,
unsigned *Update);
470 unsigned TAA,
unsigned Align,
473 return TokError(
"unexpected token in section switching directive");
478 getStreamer().SwitchSection(getContext().getMachOSection(
479 Segment, Section, TAA, StubSize,
491 getStreamer().EmitValueToAlignment(Align);
500 if (getParser().parseIdentifier(Name))
501 return TokError(
"expected identifier in directive");
504 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
507 return TokError(
".alt_entry must preceed symbol definition");
510 return TokError(
"unable to emit symbol attribute");
520 if (getParser().parseIdentifier(Name))
521 return TokError(
"expected identifier in directive");
524 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
527 return TokError(
"unexpected token in '.desc' directive");
531 if (getParser().parseAbsoluteExpression(DescValue))
535 return TokError(
"unexpected token in '.desc' directive");
540 getStreamer().EmitSymbolDesc(Sym, DescValue);
547 bool DarwinAsmParser::parseDirectiveIndirectSymbol(
StringRef,
SMLoc Loc) {
549 getStreamer().getCurrentSectionOnly());
555 return Error(Loc,
"indirect symbol not in a symbol pointer or stub " 559 if (getParser().parseIdentifier(Name))
560 return TokError(
"expected identifier in .indirect_symbol directive");
562 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
566 return TokError(
"non-local symbol required in directive");
569 return TokError(
"unable to emit indirect symbol attribute for: " + Name);
572 return TokError(
"unexpected token in '.indirect_symbol' directive");
581 bool DarwinAsmParser::parseDirectiveDumpOrLoad(
StringRef Directive,
583 bool IsDump = Directive ==
".dump";
585 return TokError(
"expected string in '.dump' or '.load' directive");
590 return TokError(
"unexpected token in '.dump' or '.load' directive");
597 return Warning(IDLoc,
"ignoring directive .dump for now");
599 return Warning(IDLoc,
"ignoring directive .load for now");
604 bool DarwinAsmParser::parseDirectiveLinkerOption(
StringRef IDVal,
SMLoc) {
608 return TokError(
"expected string in '" +
Twine(IDVal) +
"' directive");
611 if (getParser().parseEscapedString(Data))
620 return TokError(
"unexpected token in '" +
Twine(IDVal) +
"' directive");
624 getStreamer().EmitLinkerOptions(Args);
632 if (getParser().parseIdentifier(Name))
633 return TokError(
"expected identifier in directive");
636 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
639 return TokError(
"unexpected token in '.lsym' directive");
643 if (getParser().parseExpression(Value))
647 return TokError(
"unexpected token in '.lsym' directive");
655 return TokError(
"directive '.lsym' is unsupported");
661 SMLoc Loc = getLexer().getLoc();
664 if (getParser().parseIdentifier(SectionName))
665 return Error(Loc,
"expected identifier after '.section' directive");
669 return TokError(
"unexpected token in '.section' directive");
676 StringRef EOL = getLexer().LexUntilEndOfStatement();
677 SectionSpec.append(EOL.
begin(), EOL.
end());
681 return TokError(
"unexpected token in '.section' directive");
688 std::string ErrorStr =
690 TAA, TAAParsed, StubSize);
692 if (!ErrorStr.empty())
693 return Error(Loc, ErrorStr);
696 Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
701 .Case(
"__textcoal_nt",
"__text")
702 .
Case(
"__const_coal",
"__const")
703 .
Case(
"__datacoal_nt",
"__data")
706 if (!Section.
equals(NonCoalSection)) {
708 size_t B = SectionVal.find(
',') + 1,
E = SectionVal.find(
',', B);
711 getParser().Warning(Loc,
"section \"" + Section +
"\" is deprecated",
713 getParser().Note(Loc,
"change section name to \"" + NonCoalSection +
719 bool isText = Segment ==
"__TEXT";
720 getStreamer().SwitchSection(getContext().getMachOSection(
721 Segment, Section, TAA, StubSize,
728 bool DarwinAsmParser::parseDirectivePushSection(
StringRef S,
SMLoc Loc) {
729 getStreamer().PushSection();
731 if (parseDirectiveSection(S, Loc)) {
732 getStreamer().PopSection();
741 bool DarwinAsmParser::parseDirectivePopSection(
StringRef,
SMLoc) {
742 if (!getStreamer().PopSection())
743 return TokError(
".popsection without corresponding .pushsection");
749 bool DarwinAsmParser::parseDirectivePrevious(
StringRef DirName,
SMLoc) {
751 if (!PreviousSection.first)
752 return TokError(
".previous without corresponding .section");
753 getStreamer().SwitchSection(PreviousSection.first, PreviousSection.second);
759 bool DarwinAsmParser::parseDirectiveSecureLogUnique(
StringRef,
SMLoc IDLoc) {
760 StringRef LogMessage = getParser().parseStringToEndOfStatement();
762 return TokError(
"unexpected token in '.secure_log_unique' directive");
764 if (getContext().getSecureLogUsed())
765 return Error(IDLoc,
".secure_log_unique specified multiple times");
768 const char *SecureLogFile = getContext().getSecureLogFile();
770 return Error(IDLoc,
".secure_log_unique used but AS_SECURE_LOG_FILE " 771 "environment variable unset.");
777 auto NewOS = llvm::make_unique<raw_fd_ostream>(
780 return Error(IDLoc,
Twine(
"can't open secure log file: ") +
781 SecureLogFile +
" (" + EC.message() +
")");
783 getContext().setSecureLog(std::move(NewOS));
787 unsigned CurBuf = getSourceManager().FindBufferContainingLoc(IDLoc);
788 *OS << getSourceManager().getBufferInfo(CurBuf).Buffer->getBufferIdentifier()
789 <<
":" << getSourceManager().FindLineNumber(IDLoc, CurBuf) <<
":" 790 << LogMessage +
"\n";
792 getContext().setSecureLogUsed(
true);
799 bool DarwinAsmParser::parseDirectiveSecureLogReset(
StringRef,
SMLoc IDLoc) {
801 return TokError(
"unexpected token in '.secure_log_reset' directive");
805 getContext().setSecureLogUsed(
false);
812 bool DarwinAsmParser::parseDirectiveSubsectionsViaSymbols(
StringRef,
SMLoc) {
814 return TokError(
"unexpected token in '.subsections_via_symbols' directive");
826 SMLoc IDLoc = getLexer().getLoc();
828 if (getParser().parseIdentifier(Name))
829 return TokError(
"expected identifier in directive");
832 MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
835 return TokError(
"unexpected token in directive");
839 SMLoc SizeLoc = getLexer().getLoc();
840 if (getParser().parseAbsoluteExpression(Size))
843 int64_t Pow2Alignment = 0;
844 SMLoc Pow2AlignmentLoc;
847 Pow2AlignmentLoc = getLexer().getLoc();
848 if (getParser().parseAbsoluteExpression(Pow2Alignment))
853 return TokError(
"unexpected token in '.tbss' directive");
858 return Error(SizeLoc,
"invalid '.tbss' directive size, can't be less than" 862 if (Pow2Alignment < 0)
863 return Error(Pow2AlignmentLoc,
"invalid '.tbss' alignment, can't be less" 867 return Error(IDLoc,
"invalid symbol redefinition");
869 getStreamer().EmitTBSSSymbol(getContext().getMachOSection(
870 "__DATA",
"__thread_bss",
873 Sym, Size, 1 << Pow2Alignment);
883 if (getParser().parseIdentifier(Segment))
884 return TokError(
"expected segment name after '.zerofill' directive");
887 return TokError(
"unexpected token in directive");
891 SMLoc SectionLoc = getLexer().getLoc();
892 if (getParser().parseIdentifier(Section))
893 return TokError(
"expected section name after comma in '.zerofill' " 900 getStreamer().EmitZerofill(
903 nullptr, 0, 0, SectionLoc);
908 return TokError(
"unexpected token in directive");
911 SMLoc IDLoc = getLexer().getLoc();
913 if (getParser().parseIdentifier(IDStr))
914 return TokError(
"expected identifier in directive");
917 MCSymbol *Sym = getContext().getOrCreateSymbol(IDStr);
920 return TokError(
"unexpected token in directive");
924 SMLoc SizeLoc = getLexer().getLoc();
925 if (getParser().parseAbsoluteExpression(Size))
928 int64_t Pow2Alignment = 0;
929 SMLoc Pow2AlignmentLoc;
932 Pow2AlignmentLoc = getLexer().getLoc();
933 if (getParser().parseAbsoluteExpression(Pow2Alignment))
938 return TokError(
"unexpected token in '.zerofill' directive");
943 return Error(SizeLoc,
"invalid '.zerofill' directive size, can't be less " 949 if (Pow2Alignment < 0)
950 return Error(Pow2AlignmentLoc,
"invalid '.zerofill' directive alignment, " 951 "can't be less than zero");
954 return Error(IDLoc,
"invalid symbol redefinition");
959 getStreamer().EmitZerofill(getContext().getMachOSection(
962 Sym, Size, 1 << Pow2Alignment, SectionLoc);
969 bool DarwinAsmParser::parseDirectiveDataRegion(
StringRef,
SMLoc) {
976 SMLoc Loc = getParser().getTok().getLoc();
977 if (getParser().parseIdentifier(RegionType))
978 return TokError(
"expected region type after '.data_region' directive");
985 return Error(Loc,
"unknown region type in '.data_region' directive");
994 bool DarwinAsmParser::parseDirectiveDataRegionEnd(
StringRef,
SMLoc) {
996 return TokError(
"unexpected token in '.end_data_region' directive");
1008 return TokError(
"invalid OS major version number, integer expected");
1009 int64_t MajorVal = getLexer().getTok().getIntVal();
1010 if (MajorVal > 65535 || MajorVal <= 0)
1011 return TokError(
"invalid OS major version number");
1015 return TokError(
"OS minor version number required, comma expected");
1019 return TokError(
"invalid OS minor version number, integer expected");
1020 int64_t MinorVal = getLexer().getTok().getIntVal();
1021 if (MinorVal > 255 || MinorVal < 0)
1022 return TokError(
"invalid OS minor version number");
1031 return TokError(
"invalid OS update specifier, comma expected");
1034 return TokError(
"invalid OS update version number, integer expected");
1035 int64_t UpdateVal = getLexer().getTok().getIntVal();
1036 if (UpdateVal > 255 || UpdateVal < 0)
1037 return TokError(
"invalid OS update version number");
1038 *Update = UpdateVal;
1045 const Triple &
Target = getContext().getObjectFileInfo()->getTargetTriple();
1046 if (Target.
getOS() != ExpectedOS)
1049 " used while targeting " + Target.getOSName());
1051 if (LastVersionDirective.isValid()) {
1052 Warning(Loc,
"overriding previous version directive");
1053 Note(LastVersionDirective,
"previous definition is here");
1055 LastVersionDirective = Loc;
1073 bool DarwinAsmParser::parseVersionMin(
StringRef Directive,
SMLoc Loc,
1082 return addErrorSuffix(
Twine(
" in '") + Directive +
"' directive");
1085 checkVersion(Directive,
StringRef(), Loc, ExpectedOS);
1087 getStreamer().EmitVersionMin(Type, Major, Minor, Update);
1104 bool DarwinAsmParser::parseBuildVersion(
StringRef Directive,
SMLoc Loc) {
1106 SMLoc PlatformLoc = getTok().getLoc();
1107 if (getParser().parseIdentifier(PlatformName))
1108 return TokError(
"platform name expected");
1117 return Error(PlatformLoc,
"unknown platform name");
1120 return TokError(
"version number required, comma expected");
1130 return addErrorSuffix(
" in '.build_version' directive");
1134 checkVersion(Directive, PlatformName, Loc, ExpectedOS);
1136 getStreamer().EmitBuildVersion(Platform, Major, Minor, Update);
1144 return new DarwinAsmParser;
Represents a range in source code.
void push_back(const T &Elt)
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).
Compute iterated dominance frontiers using a linear time algorithm.
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.
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.
S_8BYTE_LITERALS - Section with 8 byte literals.
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.
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.
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
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_ATTR_NO_DEAD_STRIP - No dead stripping.
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).
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 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
A raw_ostream that writes to a file descriptor.
static Version parseVersion(StringRef Name)
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
LLVM Value Representation.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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()