39#define DEBUG_TYPE "wasm-asm-parser"
48 enum KindTy { Token,
Integer, Float, Symbol, BrList }
Kind;
50 SMLoc StartLoc, EndLoc;
69 std::vector<unsigned>
List;
81 :
Kind(
K), StartLoc(Start), EndLoc(
End), Tok(
T) {}
89 :
Kind(
K), StartLoc(Start), EndLoc(
End), BrL() {}
91 ~WebAssemblyOperand() {
96 bool isToken()
const override {
return Kind == Token; }
98 bool isFPImm()
const {
return Kind ==
Float; }
99 bool isMem()
const override {
return false; }
100 bool isReg()
const override {
return false; }
101 bool isBrList()
const {
return Kind == BrList; }
116 void addRegOperands(
MCInst &,
unsigned)
const {
121 void addImmOperands(
MCInst &Inst,
unsigned N)
const {
122 assert(
N == 1 &&
"Invalid number of operands!");
125 else if (Kind == Symbol)
131 void addFPImmf32Operands(
MCInst &Inst,
unsigned N)
const {
132 assert(
N == 1 &&
"Invalid number of operands!");
140 void addFPImmf64Operands(
MCInst &Inst,
unsigned N)
const {
141 assert(
N == 1 &&
"Invalid number of operands!");
148 void addBrListOperands(
MCInst &Inst,
unsigned N)
const {
149 assert(
N == 1 && isBrList() &&
"Invalid BrList!");
150 for (
auto Br : BrL.List)
157 OS <<
"Tok:" << Tok.Tok;
160 OS <<
"Int:" <<
Int.Val;
163 OS <<
"Flt:" <<
Flt.Val;
166 OS <<
"Sym:" <<
Sym.Exp;
169 OS <<
"BrList:" << BrL.List.size();
185 if (!
Sym->isFunctionTable())
189 Sym->setFunctionTable(is64);
214 } CurrentState = FileStart;
231 std::vector<Nested> NestingStack;
234 MCSymbol *LastFunctionLabel =
nullptr;
246 Lexer(Parser.getLexer()), is64(STI.getTargetTriple().isArch64Bit()),
247 TC(Parser, MII, is64), SkipTypeCheck(
Options.MCNoTypeCheck) {
253 SM.
getBufferInfo(SM.getMainFileID()).Buffer->getBufferIdentifier();
254 if (BufferName ==
"<inline asm>")
255 SkipTypeCheck =
true;
261 DefaultFunctionTable = GetOrCreateFunctionTableSymbol(
262 getContext(),
"__indirect_function_table", is64);
267#define GET_ASSEMBLER_HEADER
268#include "WebAssemblyGenAsmMatcher.inc"
275 SMLoc &EndLoc)
override {
287 std::pair<StringRef, StringRef> nestingString(NestingType NT) {
290 return {
"function",
"end_function"};
292 return {
"block",
"end_block"};
294 return {
"loop",
"end_loop"};
296 return {
"try",
"end_try/delegate"};
298 return {
"catch_all",
"end_try"};
300 return {
"if",
"end_if"};
302 return {
"else",
"end_if"};
309 NestingStack.push_back({
NT, Sig});
312 bool pop(
StringRef Ins, NestingType NT1, NestingType NT2 = Undefined) {
313 if (NestingStack.empty())
314 return error(
Twine(
"End of block construct with no start: ") + Ins);
315 auto Top = NestingStack.back();
316 if (Top.NT != NT1 && Top.NT != NT2)
317 return error(
Twine(
"Block construct type mismatch, expected: ") +
318 nestingString(Top.NT).second +
", instead got: " + Ins);
320 NestingStack.pop_back();
326 bool popAndPushWithSameSignature(
StringRef Ins, NestingType PopNT,
327 NestingType PushNT) {
328 if (NestingStack.empty())
329 return error(
Twine(
"End of block construct with no start: ") + Ins);
330 auto Sig = NestingStack.back().Sig;
337 bool ensureEmptyNestingStack(
SMLoc Loc =
SMLoc()) {
338 auto Err = !NestingStack.empty();
339 while (!NestingStack.empty()) {
340 error(
Twine(
"Unmatched block construct(s) at function end: ") +
341 nestingString(NestingStack.back().NT).first,
343 NestingStack.pop_back();
349 auto Ok = Lexer.
is(Kind);
357 return error(std::string(
"Expected ") + KindName +
", instead got: ",
364 error(
"Expected identifier, got: ", Lexer.
getTok());
387 int64_t Val =
Int.getIntVal();
390 Operands.push_back(std::make_unique<WebAssemblyOperand>(
391 WebAssemblyOperand::Integer,
Int.getLoc(),
Int.getEndLoc(),
392 WebAssemblyOperand::IntOp{Val}));
399 if (
Flt.getString().getAsDouble(Val,
false))
400 return error(
"Cannot parse real: ",
Flt);
403 Operands.push_back(std::make_unique<WebAssemblyOperand>(
404 WebAssemblyOperand::Float,
Flt.getLoc(),
Flt.getEndLoc(),
405 WebAssemblyOperand::FltOp{Val}));
414 auto S =
Flt.getString();
416 if (S.compare_insensitive(
"infinity") == 0) {
417 Val = std::numeric_limits<double>::infinity();
418 }
else if (S.compare_insensitive(
"nan") == 0) {
419 Val = std::numeric_limits<double>::quiet_NaN();
425 Operands.push_back(std::make_unique<WebAssemblyOperand>(
426 WebAssemblyOperand::Float,
Flt.getLoc(),
Flt.getEndLoc(),
427 WebAssemblyOperand::FltOp{Val}));
434 auto IsLoadStore = InstName.
contains(
".load") ||
437 auto IsAtomic = InstName.
contains(
"atomic.");
438 if (IsLoadStore || IsAtomic) {
441 auto Id = expectIdent();
443 return error(
"Expected p2align, instead got: " + Id);
447 return error(
"Expected integer constant");
448 parseSingleInteger(
false,
Operands);
453 auto IsLoadStoreLane = InstName.
contains(
"_lane");
454 if (IsLoadStoreLane &&
Operands.size() == 4)
460 auto Tok = Lexer.
getTok();
461 Operands.push_back(std::make_unique<WebAssemblyOperand>(
463 WebAssemblyOperand::IntOp{-1}));
471 if (
BT != WebAssembly::BlockType::Void) {
474 NestingStack.back().Sig = Sig;
476 Operands.push_back(std::make_unique<WebAssemblyOperand>(
477 WebAssemblyOperand::Integer, NameLoc, NameLoc,
478 WebAssemblyOperand::IntOp{
static_cast<int64_t
>(
BT)}));
482 auto Tok = Lexer.
getTok();
484 return error(
"Expected integer constant, instead got: ", Tok);
492 auto Tok = Lexer.
getTok();
494 return error(
"Expected integer constant, instead got: ", Tok);
503 bool parseFunctionTableOperand(std::unique_ptr<WebAssemblyOperand> *
Op) {
509 auto &Tok = Lexer.
getTok();
514 *
Op = std::make_unique<WebAssemblyOperand>(
516 WebAssemblyOperand::SymOp{Val});
522 *
Op = std::make_unique<WebAssemblyOperand>(
524 WebAssemblyOperand::SymOp{Val});
532 *
Op = std::make_unique<WebAssemblyOperand>(WebAssemblyOperand::Integer,
534 WebAssemblyOperand::IntOp{0});
549 auto &Sep = Lexer.
getTok();
550 if (Sep.getLoc().getPointer() !=
Name.end() ||
559 Id.getLoc().getPointer() !=
Name.end())
560 return error(
"Incomplete instruction name: ", Id);
566 Operands.push_back(std::make_unique<WebAssemblyOperand>(
568 WebAssemblyOperand::TokOp{Name}));
572 bool ExpectBlockType =
false;
573 bool ExpectFuncType =
false;
574 std::unique_ptr<WebAssemblyOperand> FunctionTable;
575 if (
Name ==
"block") {
577 ExpectBlockType =
true;
578 }
else if (
Name ==
"loop") {
580 ExpectBlockType =
true;
581 }
else if (
Name ==
"try") {
583 ExpectBlockType =
true;
584 }
else if (
Name ==
"if") {
586 ExpectBlockType =
true;
587 }
else if (
Name ==
"else") {
588 if (popAndPushWithSameSignature(
Name, If, Else))
590 }
else if (
Name ==
"catch") {
591 if (popAndPushWithSameSignature(
Name, Try, Try))
593 }
else if (
Name ==
"catch_all") {
594 if (popAndPushWithSameSignature(
Name, Try, CatchAll))
596 }
else if (
Name ==
"end_if") {
597 if (pop(
Name, If, Else))
599 }
else if (
Name ==
"end_try") {
600 if (pop(
Name, Try, CatchAll))
602 }
else if (
Name ==
"delegate") {
605 }
else if (
Name ==
"end_loop") {
608 }
else if (
Name ==
"end_block") {
609 if (pop(
Name, Block))
611 }
else if (
Name ==
"end_function") {
613 CurrentState = EndFunction;
616 }
else if (
Name ==
"call_indirect" ||
Name ==
"return_call_indirect") {
620 if (parseFunctionTableOperand(&FunctionTable))
622 ExpectFuncType =
true;
631 auto Loc = Parser.
getTok();
633 if (parseSignature(Signature))
638 NestingStack.back().Sig = *Signature;
639 ExpectBlockType =
false;
642 auto *WasmSym = cast<MCSymbolWasm>(
Sym);
643 WasmSym->setSignature(Signature);
647 Operands.push_back(std::make_unique<WebAssemblyOperand>(
648 WebAssemblyOperand::Symbol, Loc.getLoc(), Loc.getEndLoc(),
649 WebAssemblyOperand::SymOp{Expr}));
653 auto &Tok = Lexer.
getTok();
656 if (!parseSpecialFloatMaybe(
false,
Operands))
659 if (ExpectBlockType) {
662 if (
BT == WebAssembly::BlockType::Invalid)
663 return error(
"Unknown block type: ", Id);
672 return error(
"Cannot parse symbol: ", Lexer.
getTok());
673 Operands.push_back(std::make_unique<WebAssemblyOperand>(
674 WebAssemblyOperand::Symbol, Start,
End,
675 WebAssemblyOperand::SymOp{Val}));
688 if (parseSingleFloat(
true,
Operands))
690 }
else if (!parseSpecialFloatMaybe(
true,
Operands)) {
692 return error(
"Expected numeric constant instead got: ",
697 parseSingleInteger(
false,
Operands);
702 if (parseSingleFloat(
false,
Operands))
708 auto Op = std::make_unique<WebAssemblyOperand>(
722 return error(
"Unexpected token in operand: ", Tok);
729 if (ExpectBlockType &&
Operands.size() == 1) {
731 addBlockTypeOperand(
Operands, NameLoc, WebAssembly::BlockType::Void);
734 Operands.push_back(std::move(FunctionTable));
742 if (parseRegTypeList(Signature->
Params))
750 if (parseRegTypeList(Signature->
Returns))
757 bool CheckDataSection() {
758 if (CurrentState != DataSection) {
759 auto WS = cast<MCSectionWasm>(
getStreamer().getCurrentSectionOnly());
760 if (WS && WS->isText())
761 return error(
"data directive must occur in a data segment: ",
764 CurrentState = DataSection;
776 auto &Ctx = Out.getContext();
778 if (DirectiveID.
getString() ==
".globaltype") {
779 auto SymName = expectIdent();
784 auto TypeTok = Lexer.
getTok();
790 return error(
"Unknown type in .globaltype directive: ", TypeTok);
797 auto Id = expectIdent();
800 if (Id ==
"immutable")
804 return error(
"Unknown type in .globaltype modifier: ", TypeTok);
811 TOut.emitGlobalType(WasmSym);
815 if (DirectiveID.
getString() ==
".tabletype") {
817 auto SymName = expectIdent();
823 auto ElemTypeTok = Lexer.
getTok();
824 auto ElemTypeName = expectIdent();
825 if (ElemTypeName.empty())
827 std::optional<wasm::ValType> ElemType =
830 return error(
"Unknown type in .tabletype directive: ", ElemTypeTok);
844 WasmSym->setTableType(
Type);
845 TOut.emitTableType(WasmSym);
849 if (DirectiveID.
getString() ==
".functype") {
855 auto SymName = expectIdent();
859 if (WasmSym->isDefined()) {
870 if (CurrentState != FunctionLabel) {
872 if (ensureEmptyNestingStack())
876 CurrentState = FunctionStart;
877 LastFunctionLabel = WasmSym;
880 if (parseSignature(Signature))
883 WasmSym->setSignature(Signature);
885 TOut.emitFunctionType(WasmSym);
890 if (DirectiveID.
getString() ==
".export_name") {
891 auto SymName = expectIdent();
896 auto ExportName = expectIdent();
897 if (ExportName.empty())
901 TOut.emitExportName(WasmSym, ExportName);
905 if (DirectiveID.
getString() ==
".import_module") {
906 auto SymName = expectIdent();
911 auto ImportModule = expectIdent();
912 if (ImportModule.empty())
916 TOut.emitImportModule(WasmSym, ImportModule);
920 if (DirectiveID.
getString() ==
".import_name") {
921 auto SymName = expectIdent();
926 auto ImportName = expectIdent();
927 if (ImportName.
empty())
931 TOut.emitImportName(WasmSym, ImportName);
935 if (DirectiveID.
getString() ==
".tagtype") {
936 auto SymName = expectIdent();
941 if (parseRegTypeList(Signature->
Params))
943 WasmSym->setSignature(Signature);
945 TOut.emitTagType(WasmSym);
950 if (DirectiveID.
getString() ==
".local") {
951 if (CurrentState != FunctionStart)
952 return error(
".local directive should follow the start of a function: ",
955 if (parseRegTypeList(Locals))
958 TOut.emitLocal(Locals);
959 CurrentState = FunctionLocals;
963 if (DirectiveID.
getString() ==
".int8" ||
967 if (CheckDataSection())
972 return error(
"Cannot parse .int expression: ", Lexer.
getTok());
975 Out.emitValue(Val, NumBits / 8,
End);
979 if (DirectiveID.
getString() ==
".asciz") {
980 if (CheckDataSection())
984 return error(
"Cannot parse string constant: ", Lexer.
getTok());
985 Out.emitBytes(
StringRef(S.c_str(), S.length() + 1));
994 if (CurrentState == FunctionStart) {
1001 CurrentState = FunctionLocals;
1008 bool MatchingInlineAsm)
override {
1012 unsigned MatchResult = MatchInstructionImpl(
1014 switch (MatchResult) {
1021 if (Op0.getImm() == -1)
1037 if (CurrentState == EndFunction) {
1038 onEndOfFunction(IDLoc);
1045 assert(MissingFeatures.
count() > 0 &&
"Expected missing features");
1048 OS <<
"instruction requires:";
1049 for (
unsigned i = 0, e = MissingFeatures.
size(); i != e; ++i)
1050 if (MissingFeatures.
test(i))
1052 return Parser.
Error(IDLoc, Message);
1055 return Parser.
Error(IDLoc,
"invalid instruction");
1057 return Parser.
Error(IDLoc,
"ambiguous instruction");
1060 SMLoc ErrorLoc = IDLoc;
1063 return Parser.
Error(IDLoc,
"too few operands for instruction");
1065 if (ErrorLoc ==
SMLoc())
1068 return Parser.
Error(ErrorLoc,
"invalid operand for instruction");
1076 auto CWS = cast<MCSectionWasm>(
getStreamer().getCurrentSectionOnly());
1080 auto WasmSym = cast<MCSymbolWasm>(Symbol);
1085 "Wasm doesn\'t support data symbols in text sections");
1092 auto SymName =
Symbol->getName();
1093 if (SymName.starts_with(
".L"))
1100 auto SecName =
".text." + SymName;
1102 auto *Group = CWS->getGroup();
1108 WasmSym->setComdat(
true);
1116 if (WasmSym->isFunction()) {
1126 ensureEmptyNestingStack(IDLoc);
1127 CurrentState = FunctionLabel;
1128 LastFunctionLabel =
Symbol;
1133 void onEndOfFunction(
SMLoc ErrorLoc) {
1140 void onEndOfFile()
override { ensureEmptyNestingStack(); }
1150#define GET_REGISTER_MATCHER
1151#define GET_SUBTARGET_FEATURE_NAME
1152#define GET_MATCHER_IMPLEMENTATION
1153#include "WebAssemblyGenAsmMatcher.inc"
1157 for (
auto &ME : MatchTable0) {
1158 if (ME.Opcode == Opc) {
1159 return ME.getMnemonic();
1162 assert(
false &&
"mnemonic not found");
static const char * getSubtargetFeatureName(uint64_t Val)
#define LLVM_EXTERNAL_VISIBILITY
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
mir Rename Register Operands
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef GetMnemonic(unsigned Opc)
static const char * getSubtargetFeatureName(uint64_t Val)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyAsmParser()
This file is part of the WebAssembly Assembler.
This file provides WebAssembly-specific target descriptions.
This file contains the declaration of the WebAssembly-specific type parsing utility functions.
This file registers the WebAssembly target.
This file declares WebAssembly-specific target streamer classes.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
Target independent representation for an assembler token.
int64_t getIntVal() const
StringRef getString() const
Get the string for the current token, this includes all characters (for example, the quotes on string...
bool is(TokenKind K) const
TokenKind getKind() const
This class represents an Operation in the Expression.
Base class for user error types.
Container class for subtarget features.
constexpr bool test(unsigned I) const
constexpr size_t size() const
Represents a single loop in the control flow graph.
Generic assembler lexer interface, for use by target specific assembly lexers.
bool isNot(AsmToken::TokenKind K) const
Check if the current token has kind K.
const AsmToken & getTok() const
Get the current (last) lexed token.
bool is(AsmToken::TokenKind K) const
Check if the current token has kind K.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
MCStreamer & getStreamer()
Generic assembler parser interface, for use by target specific assembly parsers.
virtual bool parseEscapedString(std::string &Data)=0
Parse the current token as a string which may include escaped characters and return the string conten...
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
virtual SourceMgr & getSourceManager()=0
const AsmToken & getTok() const
Get the current AsmToken from the stream.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
bool Error(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)
Return an error at the location L, with the message Msg.
Context object for machine code objects.
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
MCSectionWasm * getWasmSection(const Twine &Section, SectionKind K, unsigned Flags=0)
wasm::WasmSignature * createWasmSignature()
Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).
bool addGenDwarfSection(MCSection *Sec)
StringRef allocateString(StringRef s)
Allocates a copy of the given string on the allocator managed by this context and returns the result.
MCSymbol * lookupSymbol(const Twine &Name) const
Get the symbol for Name, or null.
void reportError(SMLoc L, const Twine &Msg)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
const MCOperand & getOperand(unsigned i) const
Interface to description of machine instruction set.
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createSFPImm(uint32_t Val)
static MCOperand createImm(int64_t Val)
static MCOperand createDFPImm(uint64_t Val)
MCParsedAsmOperand - This abstract class represents a source-level assembly instruction operand.
virtual SMLoc getStartLoc() const =0
getStartLoc - Get the location of the first token of this operand.
virtual bool isReg() const =0
isReg - Is this a register operand?
virtual bool isMem() const =0
isMem - Is this a memory operand?
virtual MCRegister getReg() const =0
virtual void print(raw_ostream &OS) const =0
print - Print a debug representation of the operand to the given stream.
virtual bool isToken() const =0
isToken - Is this a token operand?
virtual bool isImm() const =0
isImm - Is this an immediate operand?
virtual SMLoc getEndLoc() const =0
getEndLoc - Get the location of the last token of this operand.
Wrapper class representing physical registers. Should be passed by value.
Streaming machine code generation interface.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
virtual bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
MCTargetStreamer * getTargetStreamer()
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
Generic base class for all target subtargets.
bool checkFeatures(StringRef FS) const
Check whether the subtarget features are enabled/disabled as per the provided string,...
const FeatureBitset & getFeatureBits() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
void setOmitFromLinkingSection()
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCTargetAsmParser - Generic interface to target specific assembly parsers.
virtual ParseStatus parseDirective(AsmToken DirectiveID)
Parses a target-specific assembler directive.
@ Match_InvalidTiedOperand
virtual bool parseRegister(MCRegister &Reg, SMLoc &StartLoc, SMLoc &EndLoc)=0
virtual ParseStatus tryParseRegister(MCRegister &Reg, SMLoc &StartLoc, SMLoc &EndLoc)=0
tryParseRegister - parse one register if possible
virtual void onEndOfFile()
void setAvailableFeatures(const FeatureBitset &Value)
const MCSubtargetInfo & getSTI() const
virtual void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc)
virtual bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands)=0
ParseInstruction - Parse one assembly instruction.
virtual bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, OperandVector &Operands, MCStreamer &Out, uint64_t &ErrorInfo, bool MatchingInlineAsm)=0
MatchAndEmitInstruction - Recognize a series of operands of a parsed instruction as an actual MCInst ...
Ternary parse status returned by various parse* methods.
static constexpr StatusTy Failure
static constexpr StatusTy NoMatch
Represents a location in source code.
static SMLoc getFromPointer(const char *Ptr)
constexpr const char * getPointer() const
static SectionKind getText()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
const SrcBuffer & getBufferInfo(unsigned i) const
StringRef - Represent a constant reference to a string, i.e.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
constexpr bool empty() const
empty - Check if the string is empty.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
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.
bool endOfFunction(SMLoc ErrorLoc)
void funcDecl(const wasm::WasmSignature &Sig)
void setLastSig(const wasm::WasmSignature &Sig)
void localDecl(const SmallVectorImpl< wasm::ValType > &Locals)
bool typeCheck(SMLoc ErrorLoc, const MCInst &Inst, OperandVector &Operands)
WebAssembly-specific streamer interface, to implement support WebAssembly-specific assembly directive...
virtual void emitLocal(ArrayRef< wasm::ValType > Types)=0
.local
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
int getWasm64Opcode(unsigned short Opcode)
BlockType parseBlockType(StringRef Type)
BlockType
Used as immediate MachineOperands for block signatures.
unsigned GetDefaultP2AlignAny(unsigned Opc)
Return the default p2align value for a load or store with the given opcode.
std::optional< wasm::ValType > parseType(StringRef Type)
@ WASM_SYMBOL_TYPE_GLOBAL
@ WASM_SYMBOL_TYPE_FUNCTION
@ WASM_LIMITS_FLAG_HAS_MAX
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheWebAssemblyTarget32()
Target & getTheWebAssemblyTarget64()
@ MCSA_NoDeadStrip
.no_dead_strip (MachO)
This struct is a compact representation of a valid (non-zero power of two) alignment.
RegisterMCAsmParser - Helper template for registering a target specific assembly parser,...
SmallVector< ValType, 1 > Returns
SmallVector< ValType, 4 > Params