Lines Matching refs:IO

32     IO &IO, WasmYAML::FileHeader &FileHdr) {
33 IO.mapRequired("Version", FileHdr.Version);
36 void MappingTraits<WasmYAML::Object>::mapping(IO &IO,
38 IO.setContext(&Object);
39 IO.mapTag("!WASM", true);
40 IO.mapRequired("FileHeader", Object.Header);
41 IO.mapOptional("Sections", Object.Sections);
42 IO.setContext(nullptr);
45 static void commonSectionMapping(IO &IO, WasmYAML::Section &Section) {
46 IO.mapRequired("Type", Section.Type);
47 IO.mapOptional("Relocations", Section.Relocations);
50 static void sectionMapping(IO &IO, WasmYAML::DylinkSection &Section) {
51 commonSectionMapping(IO, Section);
52 IO.mapRequired("Name", Section.Name);
53 IO.mapRequired("MemorySize", Section.MemorySize);
54 IO.mapRequired("MemoryAlignment", Section.MemoryAlignment);
55 IO.mapRequired("TableSize", Section.TableSize);
56 IO.mapRequired("TableAlignment", Section.TableAlignment);
57 IO.mapRequired("Needed", Section.Needed);
60 static void sectionMapping(IO &IO, WasmYAML::NameSection &Section) {
61 commonSectionMapping(IO, Section);
62 IO.mapRequired("Name", Section.Name);
63 IO.mapOptional("FunctionNames", Section.FunctionNames);
66 static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) {
67 commonSectionMapping(IO, Section);
68 IO.mapRequired("Name", Section.Name);
69 IO.mapRequired("Version", Section.Version);
70 IO.mapOptional("SymbolTable", Section.SymbolTable);
71 IO.mapOptional("SegmentInfo", Section.SegmentInfos);
72 IO.mapOptional("InitFunctions", Section.InitFunctions);
73 IO.mapOptional("Comdats", Section.Comdats);
76 static void sectionMapping(IO &IO, WasmYAML::ProducersSection &Section) {
77 commonSectionMapping(IO, Section);
78 IO.mapRequired("Name", Section.Name);
79 IO.mapOptional("Languages", Section.Languages);
80 IO.mapOptional("Tools", Section.Tools);
81 IO.mapOptional("SDKs", Section.SDKs);
84 static void sectionMapping(IO &IO, WasmYAML::TargetFeaturesSection &Section) {
85 commonSectionMapping(IO, Section);
86 IO.mapRequired("Name", Section.Name);
87 IO.mapRequired("Features", Section.Features);
90 static void sectionMapping(IO &IO, WasmYAML::CustomSection &Section) {
91 commonSectionMapping(IO, Section);
92 IO.mapRequired("Name", Section.Name);
93 IO.mapRequired("Payload", Section.Payload);
96 static void sectionMapping(IO &IO, WasmYAML::TypeSection &Section) {
97 commonSectionMapping(IO, Section);
98 IO.mapOptional("Signatures", Section.Signatures);
101 static void sectionMapping(IO &IO, WasmYAML::ImportSection &Section) {
102 commonSectionMapping(IO, Section);
103 IO.mapOptional("Imports", Section.Imports);
106 static void sectionMapping(IO &IO, WasmYAML::FunctionSection &Section) {
107 commonSectionMapping(IO, Section);
108 IO.mapOptional("FunctionTypes", Section.FunctionTypes);
111 static void sectionMapping(IO &IO, WasmYAML::TableSection &Section) {
112 commonSectionMapping(IO, Section);
113 IO.mapOptional("Tables", Section.Tables);
116 static void sectionMapping(IO &IO, WasmYAML::MemorySection &Section) {
117 commonSectionMapping(IO, Section);
118 IO.mapOptional("Memories", Section.Memories);
121 static void sectionMapping(IO &IO, WasmYAML::GlobalSection &Section) {
122 commonSectionMapping(IO, Section);
123 IO.mapOptional("Globals", Section.Globals);
126 static void sectionMapping(IO &IO, WasmYAML::EventSection &Section) {
127 commonSectionMapping(IO, Section);
128 IO.mapOptional("Events", Section.Events);
131 static void sectionMapping(IO &IO, WasmYAML::ExportSection &Section) {
132 commonSectionMapping(IO, Section);
133 IO.mapOptional("Exports", Section.Exports);
136 static void sectionMapping(IO &IO, WasmYAML::StartSection &Section) {
137 commonSectionMapping(IO, Section);
138 IO.mapOptional("StartFunction", Section.StartFunction);
141 static void sectionMapping(IO &IO, WasmYAML::ElemSection &Section) {
142 commonSectionMapping(IO, Section);
143 IO.mapOptional("Segments", Section.Segments);
146 static void sectionMapping(IO &IO, WasmYAML::CodeSection &Section) {
147 commonSectionMapping(IO, Section);
148 IO.mapRequired("Functions", Section.Functions);
151 static void sectionMapping(IO &IO, WasmYAML::DataSection &Section) {
152 commonSectionMapping(IO, Section);
153 IO.mapRequired("Segments", Section.Segments);
156 static void sectionMapping(IO &IO, WasmYAML::DataCountSection &Section) {
157 commonSectionMapping(IO, Section);
158 IO.mapRequired("Count", Section.Count);
162 IO &IO, std::unique_ptr<WasmYAML::Section> &Section) {
164 if (IO.outputting())
167 IO.mapRequired("Type", SectionType);
172 if (IO.outputting()) {
176 IO.mapRequired("Name", SectionName);
179 if (!IO.outputting())
181 sectionMapping(IO, *cast<WasmYAML::DylinkSection>(Section.get()));
183 if (!IO.outputting())
185 sectionMapping(IO, *cast<WasmYAML::LinkingSection>(Section.get()));
187 if (!IO.outputting())
189 sectionMapping(IO, *cast<WasmYAML::NameSection>(Section.get()));
191 if (!IO.outputting())
193 sectionMapping(IO, *cast<WasmYAML::ProducersSection>(Section.get()));
195 if (!IO.outputting())
197 sectionMapping(IO, *cast<WasmYAML::TargetFeaturesSection>(Section.get()));
199 if (!IO.outputting())
201 sectionMapping(IO, *cast<WasmYAML::CustomSection>(Section.get()));
206 if (!IO.outputting())
208 sectionMapping(IO, *cast<WasmYAML::TypeSection>(Section.get()));
211 if (!IO.outputting())
213 sectionMapping(IO, *cast<WasmYAML::ImportSection>(Section.get()));
216 if (!IO.outputting())
218 sectionMapping(IO, *cast<WasmYAML::FunctionSection>(Section.get()));
221 if (!IO.outputting())
223 sectionMapping(IO, *cast<WasmYAML::TableSection>(Section.get()));
226 if (!IO.outputting())
228 sectionMapping(IO, *cast<WasmYAML::MemorySection>(Section.get()));
231 if (!IO.outputting())
233 sectionMapping(IO, *cast<WasmYAML::GlobalSection>(Section.get()));
236 if (!IO.outputting())
238 sectionMapping(IO, *cast<WasmYAML::EventSection>(Section.get()));
241 if (!IO.outputting())
243 sectionMapping(IO, *cast<WasmYAML::ExportSection>(Section.get()));
246 if (!IO.outputting())
248 sectionMapping(IO, *cast<WasmYAML::StartSection>(Section.get()));
251 if (!IO.outputting())
253 sectionMapping(IO, *cast<WasmYAML::ElemSection>(Section.get()));
256 if (!IO.outputting())
258 sectionMapping(IO, *cast<WasmYAML::CodeSection>(Section.get()));
261 if (!IO.outputting())
263 sectionMapping(IO, *cast<WasmYAML::DataSection>(Section.get()));
266 if (!IO.outputting())
268 sectionMapping(IO, *cast<WasmYAML::DataCountSection>(Section.get()));
276 IO &IO, WasmYAML::SectionType &Type) {
277 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X);
296 IO &IO, WasmYAML::Signature &Signature) {
297 IO.mapRequired("Index", Signature.Index);
298 IO.mapRequired("ParamTypes", Signature.ParamTypes);
299 IO.mapRequired("ReturnTypes", Signature.ReturnTypes);
302 void MappingTraits<WasmYAML::Table>::mapping(IO &IO, WasmYAML::Table &Table) {
303 IO.mapRequired("ElemType", Table.ElemType);
304 IO.mapRequired("Limits", Table.TableLimits);
307 void MappingTraits<WasmYAML::Function>::mapping(IO &IO,
309 IO.mapRequired("Index", Function.Index);
310 IO.mapRequired("Locals", Function.Locals);
311 IO.mapRequired("Body", Function.Body);
315 IO &IO, WasmYAML::Relocation &Relocation) {
316 IO.mapRequired("Type", Relocation.Type);
317 IO.mapRequired("Index", Relocation.Index);
318 IO.mapRequired("Offset", Relocation.Offset);
319 IO.mapOptional("Addend", Relocation.Addend, 0);
323 IO &IO, WasmYAML::NameEntry &NameEntry) {
324 IO.mapRequired("Index", NameEntry.Index);
325 IO.mapRequired("Name", NameEntry.Name);
329 IO &IO, WasmYAML::ProducerEntry &ProducerEntry) {
330 IO.mapRequired("Name", ProducerEntry.Name);
331 IO.mapRequired("Version", ProducerEntry.Version);
335 IO &IO, WasmYAML::FeaturePolicyPrefix &Kind) {
336 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_FEATURE_PREFIX_##X);
344 IO &IO, WasmYAML::FeatureEntry &FeatureEntry) {
345 IO.mapRequired("Prefix", FeatureEntry.Prefix);
346 IO.mapRequired("Name", FeatureEntry.Name);
350 IO &IO, WasmYAML::SegmentInfo &SegmentInfo) {
351 IO.mapRequired("Index", SegmentInfo.Index);
352 IO.mapRequired("Name", SegmentInfo.Name);
353 IO.mapRequired("Alignment", SegmentInfo.Alignment);
354 IO.mapRequired("Flags", SegmentInfo.Flags);
358 IO &IO, WasmYAML::LocalDecl &LocalDecl) {
359 IO.mapRequired("Type", LocalDecl.Type);
360 IO.mapRequired("Count", LocalDecl.Count);
363 void MappingTraits<WasmYAML::Limits>::mapping(IO &IO,
365 if (!IO.outputting() || Limits.Flags)
366 IO.mapOptional("Flags", Limits.Flags);
367 IO.mapRequired("Initial", Limits.Initial);
368 if (!IO.outputting() || Limits.Flags & wasm::WASM_LIMITS_FLAG_HAS_MAX)
369 IO.mapOptional("Maximum", Limits.Maximum);
373 IO &IO, WasmYAML::ElemSegment &Segment) {
374 IO.mapRequired("Offset", Segment.Offset);
375 IO.mapRequired("Functions", Segment.Functions);
378 void MappingTraits<WasmYAML::Import>::mapping(IO &IO,
380 IO.mapRequired("Module", Import.Module);
381 IO.mapRequired("Field", Import.Field);
382 IO.mapRequired("Kind", Import.Kind);
384 IO.mapRequired("SigIndex", Import.SigIndex);
386 IO.mapRequired("GlobalType", Import.GlobalImport.Type);
387 IO.mapRequired("GlobalMutable", Import.GlobalImport.Mutable);
389 IO.mapRequired("EventAttribute", Import.EventImport.Attribute);
390 IO.mapRequired("EventSigIndex", Import.EventImport.SigIndex);
392 IO.mapRequired("Table", Import.TableImport);
394 IO.mapRequired("Memory", Import.Memory);
400 void MappingTraits<WasmYAML::Export>::mapping(IO &IO,
402 IO.mapRequired("Name", Export.Name);
403 IO.mapRequired("Kind", Export.Kind);
404 IO.mapRequired("Index", Export.Index);
407 void MappingTraits<WasmYAML::Global>::mapping(IO &IO,
409 IO.mapRequired("Index", Global.Index);
410 IO.mapRequired("Type", Global.Type);
411 IO.mapRequired("Mutable", Global.Mutable);
412 IO.mapRequired("InitExpr", Global.InitExpr);
415 void MappingTraits<wasm::WasmInitExpr>::mapping(IO &IO,
418 IO.mapRequired("Opcode", Op);
422 IO.mapRequired("Value", Expr.Value.Int32);
425 IO.mapRequired("Value", Expr.Value.Int64);
428 IO.mapRequired("Value", Expr.Value.Float32);
431 IO.mapRequired("Value", Expr.Value.Float64);
434 IO.mapRequired("Index", Expr.Value.Global);
440 IO &IO, WasmYAML::DataSegment &Segment) {
441 IO.mapOptional("SectionOffset", Segment.SectionOffset);
442 IO.mapRequired("InitFlags", Segment.InitFlags);
444 IO.mapRequired("MemoryIndex", Segment.MemoryIndex);
449 IO.mapRequired("Offset", Segment.Offset);
454 IO.mapRequired("Content", Segment.Content);
458 IO &IO, WasmYAML::InitFunction &Init) {
459 IO.mapRequired("Priority", Init.Priority);
460 IO.mapRequired("Symbol", Init.Symbol);
464 IO &IO, WasmYAML::ComdatKind &Kind) {
465 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_COMDAT_##X);
472 IO &IO, WasmYAML::ComdatEntry &ComdatEntry) {
473 IO.mapRequired("Kind", ComdatEntry.Kind);
474 IO.mapRequired("Index", ComdatEntry.Index);
477 void MappingTraits<WasmYAML::Comdat>::mapping(IO &IO,
479 IO.mapRequired("Name", Comdat.Name);
480 IO.mapRequired("Entries", Comdat.Entries);
483 void MappingTraits<WasmYAML::SymbolInfo>::mapping(IO &IO,
485 IO.mapRequired("Index", Info.Index);
486 IO.mapRequired("Kind", Info.Kind);
488 IO.mapRequired("Name", Info.Name);
489 IO.mapRequired("Flags", Info.Flags);
491 IO.mapRequired("Function", Info.ElementIndex);
493 IO.mapRequired("Global", Info.ElementIndex);
495 IO.mapRequired("Event", Info.ElementIndex);
498 IO.mapRequired("Segment", Info.DataRef.Segment);
499 IO.mapOptional("Offset", Info.DataRef.Offset, 0u);
500 IO.mapRequired("Size", Info.DataRef.Size);
503 IO.mapRequired("Section", Info.ElementIndex);
509 void MappingTraits<WasmYAML::Event>::mapping(IO &IO, WasmYAML::Event &Event) {
510 IO.mapRequired("Index", Event.Index);
511 IO.mapRequired("Attribute", Event.Attribute);
512 IO.mapRequired("SigIndex", Event.SigIndex);
516 IO &IO, WasmYAML::LimitFlags &Value) {
517 #define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_LIMITS_FLAG_##X)
524 IO &IO, WasmYAML::SegmentFlags &Value) {}
527 IO &IO, WasmYAML::SymbolFlags &Value) {
529 IO.maskedBitSetCase(Value, #X, wasm::WASM_SYMBOL_##X, wasm::WASM_SYMBOL_##M)
543 IO &IO, WasmYAML::SymbolKind &Kind) {
544 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_SYMBOL_TYPE_##X);
554 IO &IO, WasmYAML::ValueType &Type) {
555 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
567 IO &IO, WasmYAML::ExportKind &Kind) {
568 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X);
578 IO &IO, WasmYAML::Opcode &Code) {
579 #define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X);
590 IO &IO, WasmYAML::TableType &Type) {
591 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
597 IO &IO, WasmYAML::RelocType &Type) {
598 #define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);