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();
184 if (!
Sym->isFunctionTable())
188 Sym->setFunctionTable();
213 } CurrentState = FileStart;
230 std::vector<Nested> NestingStack;
233 MCSymbol *LastFunctionLabel =
nullptr;
245 Lexer(Parser.getLexer()), is64(STI.getTargetTriple().isArch64Bit()),
246 TC(Parser, MII, is64), SkipTypeCheck(
Options.MCNoTypeCheck) {
252 SM.
getBufferInfo(SM.getMainFileID()).Buffer->getBufferIdentifier();
253 if (BufferName ==
"<inline asm>")
254 SkipTypeCheck =
true;
260 DefaultFunctionTable = GetOrCreateFunctionTableSymbol(
266#define GET_ASSEMBLER_HEADER
267#include "WebAssemblyGenAsmMatcher.inc"
274 SMLoc &EndLoc)
override {
286 std::pair<StringRef, StringRef> nestingString(NestingType NT) {
289 return {
"function",
"end_function"};
291 return {
"block",
"end_block"};
293 return {
"loop",
"end_loop"};
295 return {
"try",
"end_try/delegate"};
297 return {
"catch_all",
"end_try"};
299 return {
"if",
"end_if"};
301 return {
"else",
"end_if"};
308 NestingStack.push_back({
NT, Sig});
311 bool pop(
StringRef Ins, NestingType NT1, NestingType NT2 = Undefined) {
312 if (NestingStack.empty())
313 return error(
Twine(
"End of block construct with no start: ") + Ins);
314 auto Top = NestingStack.back();
315 if (Top.NT != NT1 && Top.NT != NT2)
316 return error(
Twine(
"Block construct type mismatch, expected: ") +
317 nestingString(Top.NT).second +
", instead got: " + Ins);
319 NestingStack.pop_back();
325 bool popAndPushWithSameSignature(
StringRef Ins, NestingType PopNT,
326 NestingType PushNT) {
327 if (NestingStack.empty())
328 return error(
Twine(
"End of block construct with no start: ") + Ins);
329 auto Sig = NestingStack.back().Sig;
336 bool ensureEmptyNestingStack(
SMLoc Loc =
SMLoc()) {
337 auto Err = !NestingStack.empty();
338 while (!NestingStack.empty()) {
339 error(
Twine(
"Unmatched block construct(s) at function end: ") +
340 nestingString(NestingStack.back().NT).first,
342 NestingStack.pop_back();
348 auto Ok = Lexer.
is(Kind);
356 return error(std::string(
"Expected ") + KindName +
", instead got: ",
363 error(
"Expected identifier, got: ", Lexer.
getTok());
386 int64_t Val =
Int.getIntVal();
389 Operands.push_back(std::make_unique<WebAssemblyOperand>(
390 WebAssemblyOperand::Integer,
Int.getLoc(),
Int.getEndLoc(),
391 WebAssemblyOperand::IntOp{Val}));
398 if (
Flt.getString().getAsDouble(Val,
false))
399 return error(
"Cannot parse real: ",
Flt);
402 Operands.push_back(std::make_unique<WebAssemblyOperand>(
403 WebAssemblyOperand::Float,
Flt.getLoc(),
Flt.getEndLoc(),
404 WebAssemblyOperand::FltOp{Val}));
413 auto S =
Flt.getString();
415 if (S.compare_insensitive(
"infinity") == 0) {
416 Val = std::numeric_limits<double>::infinity();
417 }
else if (S.compare_insensitive(
"nan") == 0) {
418 Val = std::numeric_limits<double>::quiet_NaN();
424 Operands.push_back(std::make_unique<WebAssemblyOperand>(
425 WebAssemblyOperand::Float,
Flt.getLoc(),
Flt.getEndLoc(),
426 WebAssemblyOperand::FltOp{Val}));
433 auto IsLoadStore = InstName.
contains(
".load") ||
436 auto IsAtomic = InstName.
contains(
"atomic.");
437 if (IsLoadStore || IsAtomic) {
440 auto Id = expectIdent();
442 return error(
"Expected p2align, instead got: " + Id);
446 return error(
"Expected integer constant");
447 parseSingleInteger(
false,
Operands);
452 auto IsLoadStoreLane = InstName.
contains(
"_lane");
453 if (IsLoadStoreLane &&
Operands.size() == 4)
459 auto Tok = Lexer.
getTok();
460 Operands.push_back(std::make_unique<WebAssemblyOperand>(
462 WebAssemblyOperand::IntOp{-1}));
470 if (
BT != WebAssembly::BlockType::Void) {
473 NestingStack.back().Sig = Sig;
475 Operands.push_back(std::make_unique<WebAssemblyOperand>(
476 WebAssemblyOperand::Integer, NameLoc, NameLoc,
477 WebAssemblyOperand::IntOp{
static_cast<int64_t
>(
BT)}));
481 auto Tok = Lexer.
getTok();
483 return error(
"Expected integer constant, instead got: ", Tok);
491 auto Tok = Lexer.
getTok();
493 return error(
"Expected integer constant, instead got: ", Tok);
502 bool parseFunctionTableOperand(std::unique_ptr<WebAssemblyOperand> *
Op) {
508 auto &Tok = Lexer.
getTok();
513 *
Op = std::make_unique<WebAssemblyOperand>(
515 WebAssemblyOperand::SymOp{Val});
521 *
Op = std::make_unique<WebAssemblyOperand>(
523 WebAssemblyOperand::SymOp{Val});
531 *
Op = std::make_unique<WebAssemblyOperand>(WebAssemblyOperand::Integer,
533 WebAssemblyOperand::IntOp{0});
548 auto &Sep = Lexer.
getTok();
549 if (Sep.getLoc().getPointer() !=
Name.end() ||
558 Id.getLoc().getPointer() !=
Name.end())
559 return error(
"Incomplete instruction name: ", Id);
565 Operands.push_back(std::make_unique<WebAssemblyOperand>(
567 WebAssemblyOperand::TokOp{Name}));
571 bool ExpectBlockType =
false;
572 bool ExpectFuncType =
false;
573 std::unique_ptr<WebAssemblyOperand> FunctionTable;
574 if (
Name ==
"block") {
576 ExpectBlockType =
true;
577 }
else if (
Name ==
"loop") {
579 ExpectBlockType =
true;
580 }
else if (
Name ==
"try") {
582 ExpectBlockType =
true;
583 }
else if (
Name ==
"if") {
585 ExpectBlockType =
true;
586 }
else if (
Name ==
"else") {
587 if (popAndPushWithSameSignature(
Name, If, Else))
589 }
else if (
Name ==
"catch") {
590 if (popAndPushWithSameSignature(
Name, Try, Try))
592 }
else if (
Name ==
"catch_all") {
593 if (popAndPushWithSameSignature(
Name, Try, CatchAll))
595 }
else if (
Name ==
"end_if") {
596 if (pop(
Name, If, Else))
598 }
else if (
Name ==
"end_try") {
599 if (pop(
Name, Try, CatchAll))
601 }
else if (
Name ==
"delegate") {
604 }
else if (
Name ==
"end_loop") {
607 }
else if (
Name ==
"end_block") {
608 if (pop(
Name, Block))
610 }
else if (
Name ==
"end_function") {
612 CurrentState = EndFunction;
615 }
else if (
Name ==
"call_indirect" ||
Name ==
"return_call_indirect") {
619 if (parseFunctionTableOperand(&FunctionTable))
621 ExpectFuncType =
true;
630 auto Loc = Parser.
getTok();
632 if (parseSignature(Signature))
637 NestingStack.back().Sig = *Signature;
638 ExpectBlockType =
false;
641 auto *WasmSym = cast<MCSymbolWasm>(
Sym);
642 WasmSym->setSignature(Signature);
646 Operands.push_back(std::make_unique<WebAssemblyOperand>(
647 WebAssemblyOperand::Symbol, Loc.getLoc(), Loc.getEndLoc(),
648 WebAssemblyOperand::SymOp{Expr}));
652 auto &Tok = Lexer.
getTok();
655 if (!parseSpecialFloatMaybe(
false,
Operands))
658 if (ExpectBlockType) {
661 if (
BT == WebAssembly::BlockType::Invalid)
662 return error(
"Unknown block type: ", Id);
671 return error(
"Cannot parse symbol: ", Lexer.
getTok());
672 Operands.push_back(std::make_unique<WebAssemblyOperand>(
673 WebAssemblyOperand::Symbol, Start,
End,
674 WebAssemblyOperand::SymOp{Val}));
687 if (parseSingleFloat(
true,
Operands))
689 }
else if (!parseSpecialFloatMaybe(
true,
Operands)) {
691 return error(
"Expected numeric constant instead got: ",
696 parseSingleInteger(
false,
Operands);
701 if (parseSingleFloat(
false,
Operands))
707 auto Op = std::make_unique<WebAssemblyOperand>(
721 return error(
"Unexpected token in operand: ", Tok);
728 if (ExpectBlockType &&
Operands.size() == 1) {
730 addBlockTypeOperand(
Operands, NameLoc, WebAssembly::BlockType::Void);
733 Operands.push_back(std::move(FunctionTable));
741 if (parseRegTypeList(Signature->
Params))
749 if (parseRegTypeList(Signature->
Returns))
756 bool CheckDataSection() {
757 if (CurrentState != DataSection) {
758 auto WS = cast<MCSectionWasm>(
getStreamer().getCurrentSection().first);
759 if (WS && WS->getKind().isText())
760 return error(
"data directive must occur in a data segment: ",
763 CurrentState = DataSection;
775 auto &Ctx = Out.getContext();
777 if (DirectiveID.
getString() ==
".globaltype") {
778 auto SymName = expectIdent();
783 auto TypeTok = Lexer.
getTok();
789 return error(
"Unknown type in .globaltype directive: ", TypeTok);
796 auto Id = expectIdent();
799 if (Id ==
"immutable")
803 return error(
"Unknown type in .globaltype modifier: ", TypeTok);
810 TOut.emitGlobalType(WasmSym);
814 if (DirectiveID.
getString() ==
".tabletype") {
816 auto SymName = expectIdent();
822 auto ElemTypeTok = Lexer.
getTok();
823 auto ElemTypeName = expectIdent();
824 if (ElemTypeName.empty())
826 std::optional<wasm::ValType> ElemType =
829 return error(
"Unknown type in .tabletype directive: ", ElemTypeTok);
840 WasmSym->setTableType(
Type);
841 TOut.emitTableType(WasmSym);
845 if (DirectiveID.
getString() ==
".functype") {
851 auto SymName = expectIdent();
855 if (WasmSym->isDefined()) {
866 if (CurrentState != FunctionLabel) {
868 if (ensureEmptyNestingStack())
872 CurrentState = FunctionStart;
873 LastFunctionLabel = WasmSym;
876 if (parseSignature(Signature))
879 WasmSym->setSignature(Signature);
881 TOut.emitFunctionType(WasmSym);
886 if (DirectiveID.
getString() ==
".export_name") {
887 auto SymName = expectIdent();
892 auto ExportName = expectIdent();
893 if (ExportName.empty())
897 TOut.emitExportName(WasmSym, ExportName);
901 if (DirectiveID.
getString() ==
".import_module") {
902 auto SymName = expectIdent();
907 auto ImportModule = expectIdent();
908 if (ImportModule.empty())
912 TOut.emitImportModule(WasmSym, ImportModule);
916 if (DirectiveID.
getString() ==
".import_name") {
917 auto SymName = expectIdent();
922 auto ImportName = expectIdent();
923 if (ImportName.
empty())
927 TOut.emitImportName(WasmSym, ImportName);
931 if (DirectiveID.
getString() ==
".tagtype") {
932 auto SymName = expectIdent();
937 if (parseRegTypeList(Signature->
Params))
939 WasmSym->setSignature(Signature);
941 TOut.emitTagType(WasmSym);
946 if (DirectiveID.
getString() ==
".local") {
947 if (CurrentState != FunctionStart)
948 return error(
".local directive should follow the start of a function: ",
951 if (parseRegTypeList(Locals))
954 TOut.emitLocal(Locals);
955 CurrentState = FunctionLocals;
959 if (DirectiveID.
getString() ==
".int8" ||
963 if (CheckDataSection())
968 return error(
"Cannot parse .int expression: ", Lexer.
getTok());
971 Out.emitValue(Val, NumBits / 8,
End);
975 if (DirectiveID.
getString() ==
".asciz") {
976 if (CheckDataSection())
980 return error(
"Cannot parse string constant: ", Lexer.
getTok());
981 Out.emitBytes(
StringRef(S.c_str(), S.length() + 1));
990 if (CurrentState == FunctionStart) {
997 CurrentState = FunctionLocals;
1004 bool MatchingInlineAsm)
override {
1008 unsigned MatchResult = MatchInstructionImpl(
1010 switch (MatchResult) {
1017 if (Op0.getImm() == -1)
1033 if (CurrentState == EndFunction) {
1034 onEndOfFunction(IDLoc);
1041 assert(MissingFeatures.
count() > 0 &&
"Expected missing features");
1044 OS <<
"instruction requires:";
1045 for (
unsigned i = 0, e = MissingFeatures.
size(); i != e; ++i)
1046 if (MissingFeatures.
test(i))
1048 return Parser.
Error(IDLoc, Message);
1051 return Parser.
Error(IDLoc,
"invalid instruction");
1053 return Parser.
Error(IDLoc,
"ambiguous instruction");
1056 SMLoc ErrorLoc = IDLoc;
1059 return Parser.
Error(IDLoc,
"too few operands for instruction");
1061 if (ErrorLoc ==
SMLoc())
1064 return Parser.
Error(ErrorLoc,
"invalid operand for instruction");
1072 auto CWS = cast<MCSectionWasm>(
getStreamer().getCurrentSection().first);
1073 if (!CWS || !CWS->getKind().isText())
1076 auto WasmSym = cast<MCSymbolWasm>(Symbol);
1081 "Wasm doesn\'t support data symbols in text sections");
1088 auto SymName =
Symbol->getName();
1089 if (SymName.starts_with(
".L"))
1096 auto SecName =
".text." + SymName;
1098 auto *Group = CWS->getGroup();
1104 WasmSym->setComdat(
true);
1113 if (WasmSym->isFunction()) {
1123 ensureEmptyNestingStack(IDLoc);
1124 CurrentState = FunctionLabel;
1125 LastFunctionLabel =
Symbol;
1130 void onEndOfFunction(
SMLoc ErrorLoc) {
1137 void onEndOfFile()
override { ensureEmptyNestingStack(); }
1147#define GET_REGISTER_MATCHER
1148#define GET_SUBTARGET_FEATURE_NAME
1149#define GET_MATCHER_IMPLEMENTATION
1150#include "WebAssemblyGenAsmMatcher.inc"
1154 for (
auto &ME : MatchTable0) {
1155 if (ME.Opcode == Opc) {
1156 return ME.getMnemonic();
1159 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.
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)
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
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, const MCExpr *Subsection=nullptr)
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_LIMITS_FLAG_HAS_MAX
@ WASM_SYMBOL_TYPE_GLOBAL
@ WASM_SYMBOL_TYPE_FUNCTION
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