Lines Matching full:io
32 IO &IO, WasmYAML::FileHeader &FileHdr) { in mapping() argument
33 IO.mapRequired("Version", FileHdr.Version); in mapping()
36 void MappingTraits<WasmYAML::Object>::mapping(IO &IO, in mapping() argument
38 IO.setContext(&Object); in mapping()
39 IO.mapTag("!WASM", true); in mapping()
40 IO.mapRequired("FileHeader", Object.Header); in mapping()
41 IO.mapOptional("Sections", Object.Sections); in mapping()
42 IO.setContext(nullptr); in mapping()
45 static void commonSectionMapping(IO &IO, WasmYAML::Section &Section) { in commonSectionMapping() argument
46 IO.mapRequired("Type", Section.Type); in commonSectionMapping()
47 IO.mapOptional("Relocations", Section.Relocations); in commonSectionMapping()
50 static void sectionMapping(IO &IO, WasmYAML::DylinkSection &Section) { in sectionMapping() argument
51 commonSectionMapping(IO, Section); in sectionMapping()
52 IO.mapRequired("Name", Section.Name); in sectionMapping()
53 IO.mapRequired("MemorySize", Section.MemorySize); in sectionMapping()
54 IO.mapRequired("MemoryAlignment", Section.MemoryAlignment); in sectionMapping()
55 IO.mapRequired("TableSize", Section.TableSize); in sectionMapping()
56 IO.mapRequired("TableAlignment", Section.TableAlignment); in sectionMapping()
57 IO.mapRequired("Needed", Section.Needed); in sectionMapping()
60 static void sectionMapping(IO &IO, WasmYAML::NameSection &Section) { in sectionMapping() argument
61 commonSectionMapping(IO, Section); in sectionMapping()
62 IO.mapRequired("Name", Section.Name); in sectionMapping()
63 IO.mapOptional("FunctionNames", Section.FunctionNames); in sectionMapping()
64 IO.mapOptional("GlobalNames", Section.GlobalNames); in sectionMapping()
67 static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) { in sectionMapping() argument
68 commonSectionMapping(IO, Section); in sectionMapping()
69 IO.mapRequired("Name", Section.Name); in sectionMapping()
70 IO.mapRequired("Version", Section.Version); in sectionMapping()
71 IO.mapOptional("SymbolTable", Section.SymbolTable); in sectionMapping()
72 IO.mapOptional("SegmentInfo", Section.SegmentInfos); in sectionMapping()
73 IO.mapOptional("InitFunctions", Section.InitFunctions); in sectionMapping()
74 IO.mapOptional("Comdats", Section.Comdats); in sectionMapping()
77 static void sectionMapping(IO &IO, WasmYAML::ProducersSection &Section) { in sectionMapping() argument
78 commonSectionMapping(IO, Section); in sectionMapping()
79 IO.mapRequired("Name", Section.Name); in sectionMapping()
80 IO.mapOptional("Languages", Section.Languages); in sectionMapping()
81 IO.mapOptional("Tools", Section.Tools); in sectionMapping()
82 IO.mapOptional("SDKs", Section.SDKs); in sectionMapping()
85 static void sectionMapping(IO &IO, WasmYAML::TargetFeaturesSection &Section) { in sectionMapping() argument
86 commonSectionMapping(IO, Section); in sectionMapping()
87 IO.mapRequired("Name", Section.Name); in sectionMapping()
88 IO.mapRequired("Features", Section.Features); in sectionMapping()
91 static void sectionMapping(IO &IO, WasmYAML::CustomSection &Section) { in sectionMapping() argument
92 commonSectionMapping(IO, Section); in sectionMapping()
93 IO.mapRequired("Name", Section.Name); in sectionMapping()
94 IO.mapRequired("Payload", Section.Payload); in sectionMapping()
97 static void sectionMapping(IO &IO, WasmYAML::TypeSection &Section) { in sectionMapping() argument
98 commonSectionMapping(IO, Section); in sectionMapping()
99 IO.mapOptional("Signatures", Section.Signatures); in sectionMapping()
102 static void sectionMapping(IO &IO, WasmYAML::ImportSection &Section) { in sectionMapping() argument
103 commonSectionMapping(IO, Section); in sectionMapping()
104 IO.mapOptional("Imports", Section.Imports); in sectionMapping()
107 static void sectionMapping(IO &IO, WasmYAML::FunctionSection &Section) { in sectionMapping() argument
108 commonSectionMapping(IO, Section); in sectionMapping()
109 IO.mapOptional("FunctionTypes", Section.FunctionTypes); in sectionMapping()
112 static void sectionMapping(IO &IO, WasmYAML::TableSection &Section) { in sectionMapping() argument
113 commonSectionMapping(IO, Section); in sectionMapping()
114 IO.mapOptional("Tables", Section.Tables); in sectionMapping()
117 static void sectionMapping(IO &IO, WasmYAML::MemorySection &Section) { in sectionMapping() argument
118 commonSectionMapping(IO, Section); in sectionMapping()
119 IO.mapOptional("Memories", Section.Memories); in sectionMapping()
122 static void sectionMapping(IO &IO, WasmYAML::EventSection &Section) { in sectionMapping() argument
123 commonSectionMapping(IO, Section); in sectionMapping()
124 IO.mapOptional("Events", Section.Events); in sectionMapping()
127 static void sectionMapping(IO &IO, WasmYAML::GlobalSection &Section) { in sectionMapping() argument
128 commonSectionMapping(IO, Section); in sectionMapping()
129 IO.mapOptional("Globals", Section.Globals); in sectionMapping()
132 static void sectionMapping(IO &IO, WasmYAML::ExportSection &Section) { in sectionMapping() argument
133 commonSectionMapping(IO, Section); in sectionMapping()
134 IO.mapOptional("Exports", Section.Exports); in sectionMapping()
137 static void sectionMapping(IO &IO, WasmYAML::StartSection &Section) { in sectionMapping() argument
138 commonSectionMapping(IO, Section); in sectionMapping()
139 IO.mapOptional("StartFunction", Section.StartFunction); in sectionMapping()
142 static void sectionMapping(IO &IO, WasmYAML::ElemSection &Section) { in sectionMapping() argument
143 commonSectionMapping(IO, Section); in sectionMapping()
144 IO.mapOptional("Segments", Section.Segments); in sectionMapping()
147 static void sectionMapping(IO &IO, WasmYAML::CodeSection &Section) { in sectionMapping() argument
148 commonSectionMapping(IO, Section); in sectionMapping()
149 IO.mapRequired("Functions", Section.Functions); in sectionMapping()
152 static void sectionMapping(IO &IO, WasmYAML::DataSection &Section) { in sectionMapping() argument
153 commonSectionMapping(IO, Section); in sectionMapping()
154 IO.mapRequired("Segments", Section.Segments); in sectionMapping()
157 static void sectionMapping(IO &IO, WasmYAML::DataCountSection &Section) { in sectionMapping() argument
158 commonSectionMapping(IO, Section); in sectionMapping()
159 IO.mapRequired("Count", Section.Count); in sectionMapping()
163 IO &IO, std::unique_ptr<WasmYAML::Section> &Section) { in mapping() argument
165 if (IO.outputting()) in mapping()
168 IO.mapRequired("Type", SectionType); in mapping()
173 if (IO.outputting()) { in mapping()
177 IO.mapRequired("Name", SectionName); in mapping()
180 if (!IO.outputting()) in mapping()
182 sectionMapping(IO, *cast<WasmYAML::DylinkSection>(Section.get())); in mapping()
184 if (!IO.outputting()) in mapping()
186 sectionMapping(IO, *cast<WasmYAML::LinkingSection>(Section.get())); in mapping()
188 if (!IO.outputting()) in mapping()
190 sectionMapping(IO, *cast<WasmYAML::NameSection>(Section.get())); in mapping()
192 if (!IO.outputting()) in mapping()
194 sectionMapping(IO, *cast<WasmYAML::ProducersSection>(Section.get())); in mapping()
196 if (!IO.outputting()) in mapping()
198 sectionMapping(IO, *cast<WasmYAML::TargetFeaturesSection>(Section.get())); in mapping()
200 if (!IO.outputting()) in mapping()
202 sectionMapping(IO, *cast<WasmYAML::CustomSection>(Section.get())); in mapping()
207 if (!IO.outputting()) in mapping()
209 sectionMapping(IO, *cast<WasmYAML::TypeSection>(Section.get())); in mapping()
212 if (!IO.outputting()) in mapping()
214 sectionMapping(IO, *cast<WasmYAML::ImportSection>(Section.get())); in mapping()
217 if (!IO.outputting()) in mapping()
219 sectionMapping(IO, *cast<WasmYAML::FunctionSection>(Section.get())); in mapping()
222 if (!IO.outputting()) in mapping()
224 sectionMapping(IO, *cast<WasmYAML::TableSection>(Section.get())); in mapping()
227 if (!IO.outputting()) in mapping()
229 sectionMapping(IO, *cast<WasmYAML::MemorySection>(Section.get())); in mapping()
232 if (!IO.outputting()) in mapping()
234 sectionMapping(IO, *cast<WasmYAML::EventSection>(Section.get())); in mapping()
237 if (!IO.outputting()) in mapping()
239 sectionMapping(IO, *cast<WasmYAML::GlobalSection>(Section.get())); in mapping()
242 if (!IO.outputting()) in mapping()
244 sectionMapping(IO, *cast<WasmYAML::ExportSection>(Section.get())); in mapping()
247 if (!IO.outputting()) in mapping()
249 sectionMapping(IO, *cast<WasmYAML::StartSection>(Section.get())); in mapping()
252 if (!IO.outputting()) in mapping()
254 sectionMapping(IO, *cast<WasmYAML::ElemSection>(Section.get())); in mapping()
257 if (!IO.outputting()) in mapping()
259 sectionMapping(IO, *cast<WasmYAML::CodeSection>(Section.get())); in mapping()
262 if (!IO.outputting()) in mapping()
264 sectionMapping(IO, *cast<WasmYAML::DataSection>(Section.get())); in mapping()
267 if (!IO.outputting()) in mapping()
269 sectionMapping(IO, *cast<WasmYAML::DataCountSection>(Section.get())); in mapping()
277 IO &IO, WasmYAML::SectionType &Type) { in enumeration() argument
278 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X); in enumeration()
297 IO &IO, WasmYAML::Signature &Signature) { in mapping() argument
298 IO.mapRequired("Index", Signature.Index); in mapping()
299 IO.mapRequired("ParamTypes", Signature.ParamTypes); in mapping()
300 IO.mapRequired("ReturnTypes", Signature.ReturnTypes); in mapping()
303 void MappingTraits<WasmYAML::Table>::mapping(IO &IO, WasmYAML::Table &Table) { in mapping() argument
304 IO.mapRequired("Index", Table.Index); in mapping()
305 IO.mapRequired("ElemType", Table.ElemType); in mapping()
306 IO.mapRequired("Limits", Table.TableLimits); in mapping()
309 void MappingTraits<WasmYAML::Function>::mapping(IO &IO, in mapping() argument
311 IO.mapRequired("Index", Function.Index); in mapping()
312 IO.mapRequired("Locals", Function.Locals); in mapping()
313 IO.mapRequired("Body", Function.Body); in mapping()
317 IO &IO, WasmYAML::Relocation &Relocation) { in mapping() argument
318 IO.mapRequired("Type", Relocation.Type); in mapping()
319 IO.mapRequired("Index", Relocation.Index); in mapping()
320 IO.mapRequired("Offset", Relocation.Offset); in mapping()
321 IO.mapOptional("Addend", Relocation.Addend, 0); in mapping()
325 IO &IO, WasmYAML::NameEntry &NameEntry) { in mapping() argument
326 IO.mapRequired("Index", NameEntry.Index); in mapping()
327 IO.mapRequired("Name", NameEntry.Name); in mapping()
331 IO &IO, WasmYAML::ProducerEntry &ProducerEntry) { in mapping() argument
332 IO.mapRequired("Name", ProducerEntry.Name); in mapping()
333 IO.mapRequired("Version", ProducerEntry.Version); in mapping()
337 IO &IO, WasmYAML::FeaturePolicyPrefix &Kind) { in enumeration() argument
338 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_FEATURE_PREFIX_##X); in enumeration()
346 IO &IO, WasmYAML::FeatureEntry &FeatureEntry) { in mapping() argument
347 IO.mapRequired("Prefix", FeatureEntry.Prefix); in mapping()
348 IO.mapRequired("Name", FeatureEntry.Name); in mapping()
352 IO &IO, WasmYAML::SegmentInfo &SegmentInfo) { in mapping() argument
353 IO.mapRequired("Index", SegmentInfo.Index); in mapping()
354 IO.mapRequired("Name", SegmentInfo.Name); in mapping()
355 IO.mapRequired("Alignment", SegmentInfo.Alignment); in mapping()
356 IO.mapRequired("Flags", SegmentInfo.Flags); in mapping()
360 IO &IO, WasmYAML::LocalDecl &LocalDecl) { in mapping() argument
361 IO.mapRequired("Type", LocalDecl.Type); in mapping()
362 IO.mapRequired("Count", LocalDecl.Count); in mapping()
365 void MappingTraits<WasmYAML::Limits>::mapping(IO &IO, in mapping() argument
367 if (!IO.outputting() || Limits.Flags) in mapping()
368 IO.mapOptional("Flags", Limits.Flags); in mapping()
369 IO.mapRequired("Initial", Limits.Initial); in mapping()
370 if (!IO.outputting() || Limits.Flags & wasm::WASM_LIMITS_FLAG_HAS_MAX) in mapping()
371 IO.mapOptional("Maximum", Limits.Maximum); in mapping()
375 IO &IO, WasmYAML::ElemSegment &Segment) { in mapping() argument
376 IO.mapRequired("Offset", Segment.Offset); in mapping()
377 IO.mapRequired("Functions", Segment.Functions); in mapping()
380 void MappingTraits<WasmYAML::Import>::mapping(IO &IO, in mapping() argument
382 IO.mapRequired("Module", Import.Module); in mapping()
383 IO.mapRequired("Field", Import.Field); in mapping()
384 IO.mapRequired("Kind", Import.Kind); in mapping()
386 IO.mapRequired("SigIndex", Import.SigIndex); in mapping()
388 IO.mapRequired("GlobalType", Import.GlobalImport.Type); in mapping()
389 IO.mapRequired("GlobalMutable", Import.GlobalImport.Mutable); in mapping()
391 IO.mapRequired("EventAttribute", Import.EventImport.Attribute); in mapping()
392 IO.mapRequired("EventSigIndex", Import.EventImport.SigIndex); in mapping()
394 IO.mapRequired("Table", Import.TableImport); in mapping()
396 IO.mapRequired("Memory", Import.Memory); in mapping()
402 void MappingTraits<WasmYAML::Export>::mapping(IO &IO, in mapping() argument
404 IO.mapRequired("Name", Export.Name); in mapping()
405 IO.mapRequired("Kind", Export.Kind); in mapping()
406 IO.mapRequired("Index", Export.Index); in mapping()
409 void MappingTraits<WasmYAML::Global>::mapping(IO &IO, in mapping() argument
411 IO.mapRequired("Index", Global.Index); in mapping()
412 IO.mapRequired("Type", Global.Type); in mapping()
413 IO.mapRequired("Mutable", Global.Mutable); in mapping()
414 IO.mapRequired("InitExpr", Global.InitExpr); in mapping()
417 void MappingTraits<wasm::WasmInitExpr>::mapping(IO &IO, in mapping() argument
420 IO.mapRequired("Opcode", Op); in mapping()
424 IO.mapRequired("Value", Expr.Value.Int32); in mapping()
427 IO.mapRequired("Value", Expr.Value.Int64); in mapping()
430 IO.mapRequired("Value", Expr.Value.Float32); in mapping()
433 IO.mapRequired("Value", Expr.Value.Float64); in mapping()
436 IO.mapRequired("Index", Expr.Value.Global); in mapping()
440 IO.mapRequired("Type", Ty); in mapping()
447 IO &IO, WasmYAML::DataSegment &Segment) { in mapping() argument
448 IO.mapOptional("SectionOffset", Segment.SectionOffset); in mapping()
449 IO.mapRequired("InitFlags", Segment.InitFlags); in mapping()
451 IO.mapRequired("MemoryIndex", Segment.MemoryIndex); in mapping()
456 IO.mapRequired("Offset", Segment.Offset); in mapping()
461 IO.mapRequired("Content", Segment.Content); in mapping()
465 IO &IO, WasmYAML::InitFunction &Init) { in mapping() argument
466 IO.mapRequired("Priority", Init.Priority); in mapping()
467 IO.mapRequired("Symbol", Init.Symbol); in mapping()
471 IO &IO, WasmYAML::ComdatKind &Kind) { in enumeration() argument
472 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_COMDAT_##X); in enumeration()
480 IO &IO, WasmYAML::ComdatEntry &ComdatEntry) { in mapping() argument
481 IO.mapRequired("Kind", ComdatEntry.Kind); in mapping()
482 IO.mapRequired("Index", ComdatEntry.Index); in mapping()
485 void MappingTraits<WasmYAML::Comdat>::mapping(IO &IO, in mapping() argument
487 IO.mapRequired("Name", Comdat.Name); in mapping()
488 IO.mapRequired("Entries", Comdat.Entries); in mapping()
491 void MappingTraits<WasmYAML::SymbolInfo>::mapping(IO &IO, in mapping() argument
493 IO.mapRequired("Index", Info.Index); in mapping()
494 IO.mapRequired("Kind", Info.Kind); in mapping()
496 IO.mapRequired("Name", Info.Name); in mapping()
497 IO.mapRequired("Flags", Info.Flags); in mapping()
499 IO.mapRequired("Function", Info.ElementIndex); in mapping()
501 IO.mapRequired("Global", Info.ElementIndex); in mapping()
503 IO.mapRequired("Table", Info.ElementIndex); in mapping()
505 IO.mapRequired("Event", Info.ElementIndex); in mapping()
508 IO.mapRequired("Segment", Info.DataRef.Segment); in mapping()
509 IO.mapOptional("Offset", Info.DataRef.Offset, 0u); in mapping()
510 IO.mapRequired("Size", Info.DataRef.Size); in mapping()
513 IO.mapRequired("Section", Info.ElementIndex); in mapping()
519 void MappingTraits<WasmYAML::Event>::mapping(IO &IO, WasmYAML::Event &Event) { in mapping() argument
520 IO.mapRequired("Index", Event.Index); in mapping()
521 IO.mapRequired("Attribute", Event.Attribute); in mapping()
522 IO.mapRequired("SigIndex", Event.SigIndex); in mapping()
526 IO &IO, WasmYAML::LimitFlags &Value) { in bitset() argument
527 #define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_LIMITS_FLAG_##X) in bitset()
535 IO &IO, WasmYAML::SegmentFlags &Value) {} in bitset() argument
538 IO &IO, WasmYAML::SymbolFlags &Value) { in bitset() argument
540 IO.maskedBitSetCase(Value, #X, wasm::WASM_SYMBOL_##X, wasm::WASM_SYMBOL_##M) in bitset()
554 IO &IO, WasmYAML::SymbolKind &Kind) { in enumeration() argument
555 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_SYMBOL_TYPE_##X); in enumeration()
566 IO &IO, WasmYAML::ValueType &Type) { in enumeration() argument
567 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X); in enumeration()
581 IO &IO, WasmYAML::ExportKind &Kind) { in enumeration() argument
582 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X); in enumeration()
592 IO &IO, WasmYAML::Opcode &Code) { in enumeration() argument
593 #define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X); in enumeration()
605 IO &IO, WasmYAML::TableType &Type) { in enumeration() argument
606 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X); in enumeration()
613 IO &IO, WasmYAML::RelocType &Type) { in enumeration() argument
614 #define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name); in enumeration()