127 IO &
IO, std::unique_ptr<WasmYAML::Section> &
Section) {
130 SectionType = Section->Type;
134 switch (SectionType) {
138 auto CustomSection = cast<WasmYAML::CustomSection>(Section.get());
139 SectionName = CustomSection->Name;
143 if (SectionName ==
"linking") {
146 sectionMapping(IO, *cast<WasmYAML::LinkingSection>(Section.get()));
147 }
else if (SectionName ==
"name") {
154 sectionMapping(IO, *cast<WasmYAML::CustomSection>(Section.get()));
166 sectionMapping(IO, *cast<WasmYAML::ImportSection>(Section.get()));
171 sectionMapping(IO, *cast<WasmYAML::FunctionSection>(Section.get()));
181 sectionMapping(IO, *cast<WasmYAML::MemorySection>(Section.get()));
186 sectionMapping(IO, *cast<WasmYAML::GlobalSection>(Section.get()));
191 sectionMapping(IO, *cast<WasmYAML::ExportSection>(Section.get()));
220 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X);
362 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
374 IO &
IO, WasmYAML::ExportKind &
Kind) {
375 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X);
384 IO &
IO, WasmYAML::Opcode &Code) {
385 #define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X);
396 IO &
IO, WasmYAML::TableType &
Type) {
397 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
403 IO &
IO, WasmYAML::RelocType &
Type) {
404 #define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);
405 #include "llvm/BinaryFormat/WasmRelocs/WebAssembly.def"
std::vector< Relocation > Relocations
std::vector< Limits > Memories
void mapOptional(const char *Key, T &Val)
std::vector< Signature > Signatures
std::vector< std::unique_ptr< Section > > Sections
wasm::WasmInitExpr InitExpr
std::vector< Import > Imports
wasm::WasmInitExpr Offset
std::vector< Function > Functions
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
virtual bool mapTag(StringRef Tag, bool Default=false)=0
This file declares classes for handling the YAML representation of wasm binaries. ...
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
The instances of the Type class are immutable: once they are created, they are never changed...
std::vector< Export > Exports
std::vector< SymbolInfo > SymbolInfos
union llvm::wasm::WasmInitExpr::@125 Value
std::vector< uint32_t > FunctionTypes
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
std::vector< Table > Tables
std::vector< ElemSegment > Segments
llvm_unreachable("Unknown RegBank!")
std::vector< uint32_t > Functions
std::vector< DataSegment > Segments
std::vector< ValueType > ParamTypes
std::vector< LocalDecl > Locals
virtual bool outputting()=0
std::vector< NameEntry > FunctionNames
std::vector< Global > Globals
static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section)
wasm::WasmInitExpr Offset
StringRef - Represent a constant reference to a string, i.e.
void mapRequired(const char *Key, T &Val)
SectionType
These are the section type and attributes fields.