LLVM  9.0.0svn
WasmYAML.cpp
Go to the documentation of this file.
1 //===- WasmYAML.cpp - Wasm YAMLIO implementation --------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines classes for handling the YAML representation of wasm.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Casting.h"
18 
19 namespace llvm {
20 
21 namespace WasmYAML {
22 
23 // Declared here rather than in the header to comply with:
24 // http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers
25 Section::~Section() = default;
26 
27 } // end namespace WasmYAML
28 
29 namespace yaml {
30 
32  IO &IO, WasmYAML::FileHeader &FileHdr) {
33  IO.mapRequired("Version", FileHdr.Version);
34 }
35 
37  WasmYAML::Object &Object) {
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);
43 }
44 
46  IO.mapRequired("Type", Section.Type);
47  IO.mapOptional("Relocations", Section.Relocations);
48 }
49 
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);
58 }
59 
61  commonSectionMapping(IO, Section);
62  IO.mapRequired("Name", Section.Name);
63  IO.mapOptional("FunctionNames", Section.FunctionNames);
64 }
65 
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);
74 }
75 
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);
82 }
83 
85  commonSectionMapping(IO, Section);
86  IO.mapRequired("Name", Section.Name);
87  IO.mapRequired("Features", Section.Features);
88 }
89 
91  commonSectionMapping(IO, Section);
92  IO.mapRequired("Name", Section.Name);
93  IO.mapRequired("Payload", Section.Payload);
94 }
95 
97  commonSectionMapping(IO, Section);
98  IO.mapOptional("Signatures", Section.Signatures);
99 }
100 
102  commonSectionMapping(IO, Section);
103  IO.mapOptional("Imports", Section.Imports);
104 }
105 
107  commonSectionMapping(IO, Section);
108  IO.mapOptional("FunctionTypes", Section.FunctionTypes);
109 }
110 
112  commonSectionMapping(IO, Section);
113  IO.mapOptional("Tables", Section.Tables);
114 }
115 
117  commonSectionMapping(IO, Section);
118  IO.mapOptional("Memories", Section.Memories);
119 }
120 
122  commonSectionMapping(IO, Section);
123  IO.mapOptional("Globals", Section.Globals);
124 }
125 
127  commonSectionMapping(IO, Section);
128  IO.mapOptional("Events", Section.Events);
129 }
130 
132  commonSectionMapping(IO, Section);
133  IO.mapOptional("Exports", Section.Exports);
134 }
135 
137  commonSectionMapping(IO, Section);
138  IO.mapOptional("StartFunction", Section.StartFunction);
139 }
140 
142  commonSectionMapping(IO, Section);
143  IO.mapOptional("Segments", Section.Segments);
144 }
145 
147  commonSectionMapping(IO, Section);
148  IO.mapRequired("Functions", Section.Functions);
149 }
150 
152  commonSectionMapping(IO, Section);
153  IO.mapRequired("Segments", Section.Segments);
154 }
155 
157  commonSectionMapping(IO, Section);
158  IO.mapRequired("Count", Section.Count);
159 }
160 
162  IO &IO, std::unique_ptr<WasmYAML::Section> &Section) {
164  if (IO.outputting())
165  SectionType = Section->Type;
166  else
167  IO.mapRequired("Type", SectionType);
168 
169  switch (SectionType) {
170  case wasm::WASM_SEC_CUSTOM: {
172  if (IO.outputting()) {
173  auto CustomSection = cast<WasmYAML::CustomSection>(Section.get());
174  SectionName = CustomSection->Name;
175  } else {
176  IO.mapRequired("Name", SectionName);
177  }
178  if (SectionName == "dylink") {
179  if (!IO.outputting())
180  Section.reset(new WasmYAML::DylinkSection());
181  sectionMapping(IO, *cast<WasmYAML::DylinkSection>(Section.get()));
182  } else if (SectionName == "linking") {
183  if (!IO.outputting())
184  Section.reset(new WasmYAML::LinkingSection());
185  sectionMapping(IO, *cast<WasmYAML::LinkingSection>(Section.get()));
186  } else if (SectionName == "name") {
187  if (!IO.outputting())
188  Section.reset(new WasmYAML::NameSection());
189  sectionMapping(IO, *cast<WasmYAML::NameSection>(Section.get()));
190  } else if (SectionName == "producers") {
191  if (!IO.outputting())
192  Section.reset(new WasmYAML::ProducersSection());
193  sectionMapping(IO, *cast<WasmYAML::ProducersSection>(Section.get()));
194  } else if (SectionName == "target_features") {
195  if (!IO.outputting())
196  Section.reset(new WasmYAML::TargetFeaturesSection());
197  sectionMapping(IO, *cast<WasmYAML::TargetFeaturesSection>(Section.get()));
198  } else {
199  if (!IO.outputting())
200  Section.reset(new WasmYAML::CustomSection(SectionName));
201  sectionMapping(IO, *cast<WasmYAML::CustomSection>(Section.get()));
202  }
203  break;
204  }
205  case wasm::WASM_SEC_TYPE:
206  if (!IO.outputting())
207  Section.reset(new WasmYAML::TypeSection());
208  sectionMapping(IO, *cast<WasmYAML::TypeSection>(Section.get()));
209  break;
211  if (!IO.outputting())
212  Section.reset(new WasmYAML::ImportSection());
213  sectionMapping(IO, *cast<WasmYAML::ImportSection>(Section.get()));
214  break;
216  if (!IO.outputting())
217  Section.reset(new WasmYAML::FunctionSection());
218  sectionMapping(IO, *cast<WasmYAML::FunctionSection>(Section.get()));
219  break;
221  if (!IO.outputting())
222  Section.reset(new WasmYAML::TableSection());
223  sectionMapping(IO, *cast<WasmYAML::TableSection>(Section.get()));
224  break;
226  if (!IO.outputting())
227  Section.reset(new WasmYAML::MemorySection());
228  sectionMapping(IO, *cast<WasmYAML::MemorySection>(Section.get()));
229  break;
231  if (!IO.outputting())
232  Section.reset(new WasmYAML::GlobalSection());
233  sectionMapping(IO, *cast<WasmYAML::GlobalSection>(Section.get()));
234  break;
236  if (!IO.outputting())
237  Section.reset(new WasmYAML::EventSection());
238  sectionMapping(IO, *cast<WasmYAML::EventSection>(Section.get()));
239  break;
241  if (!IO.outputting())
242  Section.reset(new WasmYAML::ExportSection());
243  sectionMapping(IO, *cast<WasmYAML::ExportSection>(Section.get()));
244  break;
246  if (!IO.outputting())
247  Section.reset(new WasmYAML::StartSection());
248  sectionMapping(IO, *cast<WasmYAML::StartSection>(Section.get()));
249  break;
250  case wasm::WASM_SEC_ELEM:
251  if (!IO.outputting())
252  Section.reset(new WasmYAML::ElemSection());
253  sectionMapping(IO, *cast<WasmYAML::ElemSection>(Section.get()));
254  break;
255  case wasm::WASM_SEC_CODE:
256  if (!IO.outputting())
257  Section.reset(new WasmYAML::CodeSection());
258  sectionMapping(IO, *cast<WasmYAML::CodeSection>(Section.get()));
259  break;
260  case wasm::WASM_SEC_DATA:
261  if (!IO.outputting())
262  Section.reset(new WasmYAML::DataSection());
263  sectionMapping(IO, *cast<WasmYAML::DataSection>(Section.get()));
264  break;
266  if (!IO.outputting())
267  Section.reset(new WasmYAML::DataCountSection());
268  sectionMapping(IO, *cast<WasmYAML::DataCountSection>(Section.get()));
269  break;
270  default:
271  llvm_unreachable("Unknown section type");
272  }
273 }
274 
275 void ScalarEnumerationTraits<WasmYAML::SectionType>::enumeration(
276  IO &IO, WasmYAML::SectionType &Type) {
277 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X);
278  ECase(CUSTOM);
279  ECase(TYPE);
280  ECase(IMPORT);
281  ECase(FUNCTION);
282  ECase(TABLE);
283  ECase(MEMORY);
284  ECase(GLOBAL);
285  ECase(EVENT);
286  ECase(EXPORT);
287  ECase(START);
288  ECase(ELEM);
289  ECase(CODE);
290  ECase(DATA);
291  ECase(DATACOUNT);
292 #undef ECase
293 }
294 
296  IO &IO, WasmYAML::Signature &Signature) {
297  IO.mapRequired("Index", Signature.Index);
298  IO.mapRequired("ReturnType", Signature.ReturnType);
299  IO.mapRequired("ParamTypes", Signature.ParamTypes);
300 }
301 
303  IO.mapRequired("ElemType", Table.ElemType);
304  IO.mapRequired("Limits", Table.TableLimits);
305 }
306 
309  IO.mapRequired("Index", Function.Index);
310  IO.mapRequired("Locals", Function.Locals);
311  IO.mapRequired("Body", Function.Body);
312 }
313 
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);
320 }
321 
323  IO &IO, WasmYAML::NameEntry &NameEntry) {
324  IO.mapRequired("Index", NameEntry.Index);
325  IO.mapRequired("Name", NameEntry.Name);
326 }
327 
329  IO &IO, WasmYAML::ProducerEntry &ProducerEntry) {
330  IO.mapRequired("Name", ProducerEntry.Name);
331  IO.mapRequired("Version", ProducerEntry.Version);
332 }
333 
334 void ScalarEnumerationTraits<WasmYAML::FeaturePolicyPrefix>::enumeration(
335  IO &IO, WasmYAML::FeaturePolicyPrefix &Kind) {
336 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_FEATURE_PREFIX_##X);
337  ECase(USED);
338  ECase(REQUIRED);
339  ECase(DISALLOWED);
340 #undef ECase
341 }
342 
344  IO &IO, WasmYAML::FeatureEntry &FeatureEntry) {
345  IO.mapRequired("Prefix", FeatureEntry.Prefix);
346  IO.mapRequired("Name", FeatureEntry.Name);
347 }
348 
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);
355 }
356 
358  IO &IO, WasmYAML::LocalDecl &LocalDecl) {
359  IO.mapRequired("Type", LocalDecl.Type);
360  IO.mapRequired("Count", LocalDecl.Count);
361 }
362 
364  WasmYAML::Limits &Limits) {
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);
370 }
371 
373  IO &IO, WasmYAML::ElemSegment &Segment) {
374  IO.mapRequired("Offset", Segment.Offset);
375  IO.mapRequired("Functions", Segment.Functions);
376 }
377 
379  WasmYAML::Import &Import) {
380  IO.mapRequired("Module", Import.Module);
381  IO.mapRequired("Field", Import.Field);
382  IO.mapRequired("Kind", Import.Kind);
383  if (Import.Kind == wasm::WASM_EXTERNAL_FUNCTION) {
384  IO.mapRequired("SigIndex", Import.SigIndex);
385  } else if (Import.Kind == wasm::WASM_EXTERNAL_GLOBAL) {
386  IO.mapRequired("GlobalType", Import.GlobalImport.Type);
387  IO.mapRequired("GlobalMutable", Import.GlobalImport.Mutable);
388  } else if (Import.Kind == wasm::WASM_EXTERNAL_EVENT) {
389  IO.mapRequired("EventAttribute", Import.EventImport.Attribute);
390  IO.mapRequired("EventSigIndex", Import.EventImport.SigIndex);
391  } else if (Import.Kind == wasm::WASM_EXTERNAL_TABLE) {
392  IO.mapRequired("Table", Import.TableImport);
393  } else if (Import.Kind == wasm::WASM_EXTERNAL_MEMORY) {
394  IO.mapRequired("Memory", Import.Memory);
395  } else {
396  llvm_unreachable("unhandled import type");
397  }
398 }
399 
401  WasmYAML::Export &Export) {
402  IO.mapRequired("Name", Export.Name);
403  IO.mapRequired("Kind", Export.Kind);
404  IO.mapRequired("Index", Export.Index);
405 }
406 
408  WasmYAML::Global &Global) {
409  IO.mapRequired("Index", Global.Index);
410  IO.mapRequired("Type", Global.Type);
411  IO.mapRequired("Mutable", Global.Mutable);
412  IO.mapRequired("InitExpr", Global.InitExpr);
413 }
414 
416  wasm::WasmInitExpr &Expr) {
417  WasmYAML::Opcode Op = Expr.Opcode;
418  IO.mapRequired("Opcode", Op);
419  Expr.Opcode = Op;
420  switch (Expr.Opcode) {
422  IO.mapRequired("Value", Expr.Value.Int32);
423  break;
425  IO.mapRequired("Value", Expr.Value.Int64);
426  break;
428  IO.mapRequired("Value", Expr.Value.Float32);
429  break;
431  IO.mapRequired("Value", Expr.Value.Float64);
432  break;
434  IO.mapRequired("Index", Expr.Value.Global);
435  break;
436  }
437 }
438 
440  IO &IO, WasmYAML::DataSegment &Segment) {
441  IO.mapOptional("SectionOffset", Segment.SectionOffset);
442  IO.mapRequired("InitFlags", Segment.InitFlags);
444  IO.mapRequired("MemoryIndex", Segment.MemoryIndex);
445  } else {
446  Segment.MemoryIndex = 0;
447  }
448  if ((Segment.InitFlags & wasm::WASM_SEGMENT_IS_PASSIVE) == 0) {
449  IO.mapRequired("Offset", Segment.Offset);
450  } else {
452  Segment.Offset.Value.Int32 = 0;
453  }
454  IO.mapRequired("Content", Segment.Content);
455 }
456 
458  IO &IO, WasmYAML::InitFunction &Init) {
459  IO.mapRequired("Priority", Init.Priority);
460  IO.mapRequired("Symbol", Init.Symbol);
461 }
462 
463 void ScalarEnumerationTraits<WasmYAML::ComdatKind>::enumeration(
464  IO &IO, WasmYAML::ComdatKind &Kind) {
465 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_COMDAT_##X);
466  ECase(FUNCTION);
467  ECase(DATA);
468 #undef ECase
469 }
470 
472  IO &IO, WasmYAML::ComdatEntry &ComdatEntry) {
473  IO.mapRequired("Kind", ComdatEntry.Kind);
474  IO.mapRequired("Index", ComdatEntry.Index);
475 }
476 
479  IO.mapRequired("Name", Comdat.Name);
480  IO.mapRequired("Entries", Comdat.Entries);
481 }
482 
485  IO.mapRequired("Index", Info.Index);
486  IO.mapRequired("Kind", Info.Kind);
487  IO.mapRequired("Name", Info.Name);
488  IO.mapRequired("Flags", Info.Flags);
490  IO.mapRequired("Function", Info.ElementIndex);
491  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_GLOBAL) {
492  IO.mapRequired("Global", Info.ElementIndex);
493  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_EVENT) {
494  IO.mapRequired("Event", Info.ElementIndex);
495  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_DATA) {
496  if ((Info.Flags & wasm::WASM_SYMBOL_UNDEFINED) == 0) {
497  IO.mapRequired("Segment", Info.DataRef.Segment);
498  IO.mapOptional("Offset", Info.DataRef.Offset, 0u);
499  IO.mapRequired("Size", Info.DataRef.Size);
500  }
501  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_SECTION) {
502  IO.mapRequired("Section", Info.ElementIndex);
503  } else {
504  llvm_unreachable("unsupported symbol kind");
505  }
506 }
507 
509  IO.mapRequired("Index", Event.Index);
510  IO.mapRequired("Attribute", Event.Attribute);
511  IO.mapRequired("SigIndex", Event.SigIndex);
512 }
513 
514 void ScalarBitSetTraits<WasmYAML::LimitFlags>::bitset(
515  IO &IO, WasmYAML::LimitFlags &Value) {
516 #define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_LIMITS_FLAG_##X)
517  BCase(HAS_MAX);
518  BCase(IS_SHARED);
519 #undef BCase
520 }
521 
522 void ScalarBitSetTraits<WasmYAML::SegmentFlags>::bitset(
523  IO &IO, WasmYAML::SegmentFlags &Value) {}
524 
525 void ScalarBitSetTraits<WasmYAML::SymbolFlags>::bitset(
526  IO &IO, WasmYAML::SymbolFlags &Value) {
527 #define BCaseMask(M, X) \
528  IO.maskedBitSetCase(Value, #X, wasm::WASM_SYMBOL_##X, wasm::WASM_SYMBOL_##M)
529  // BCaseMask(BINDING_MASK, BINDING_GLOBAL);
530  BCaseMask(BINDING_MASK, BINDING_WEAK);
531  BCaseMask(BINDING_MASK, BINDING_LOCAL);
532  // BCaseMask(VISIBILITY_MASK, VISIBILITY_DEFAULT);
533  BCaseMask(VISIBILITY_MASK, VISIBILITY_HIDDEN);
534  BCaseMask(UNDEFINED, UNDEFINED);
535  BCaseMask(EXPORTED, EXPORTED);
536 #undef BCaseMask
537 }
538 
539 void ScalarEnumerationTraits<WasmYAML::SymbolKind>::enumeration(
540  IO &IO, WasmYAML::SymbolKind &Kind) {
541 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_SYMBOL_TYPE_##X);
542  ECase(FUNCTION);
543  ECase(DATA);
544  ECase(GLOBAL);
545  ECase(SECTION);
546  ECase(EVENT);
547 #undef ECase
548 }
549 
550 void ScalarEnumerationTraits<WasmYAML::ValueType>::enumeration(
551  IO &IO, WasmYAML::ValueType &Type) {
552 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
553  ECase(I32);
554  ECase(I64);
555  ECase(F32);
556  ECase(F64);
557  ECase(V128);
558  ECase(FUNCREF);
559  ECase(FUNC);
560  ECase(NORESULT);
561 #undef ECase
562 }
563 
564 void ScalarEnumerationTraits<WasmYAML::ExportKind>::enumeration(
565  IO &IO, WasmYAML::ExportKind &Kind) {
566 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X);
567  ECase(FUNCTION);
568  ECase(TABLE);
569  ECase(MEMORY);
570  ECase(GLOBAL);
571  ECase(EVENT);
572 #undef ECase
573 }
574 
575 void ScalarEnumerationTraits<WasmYAML::Opcode>::enumeration(
576  IO &IO, WasmYAML::Opcode &Code) {
577 #define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X);
578  ECase(END);
579  ECase(I32_CONST);
580  ECase(I64_CONST);
581  ECase(F64_CONST);
582  ECase(F32_CONST);
583  ECase(GLOBAL_GET);
584 #undef ECase
585 }
586 
587 void ScalarEnumerationTraits<WasmYAML::TableType>::enumeration(
588  IO &IO, WasmYAML::TableType &Type) {
589 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
590  ECase(FUNCREF);
591 #undef ECase
592 }
593 
594 void ScalarEnumerationTraits<WasmYAML::RelocType>::enumeration(
595  IO &IO, WasmYAML::RelocType &Type) {
596 #define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);
597 #include "llvm/BinaryFormat/WasmRelocs.def"
598 #undef WASM_RELOC
599 }
600 
601 } // end namespace yaml
602 
603 } // end namespace llvm
std::vector< InitFunction > InitFunctions
Definition: WasmYAML.h:234
std::vector< Comdat > Comdats
Definition: WasmYAML.h:235
std::vector< Relocation > Relocations
Definition: WasmYAML.h:182
std::vector< Limits > Memories
Definition: WasmYAML.h:309
std::vector< Signature > Signatures
Definition: WasmYAML.h:269
This class represents lattice values for constants.
Definition: AllocatorList.h:23
yaml::BinaryRef Body
Definition: WasmYAML.h:104
std::vector< std::unique_ptr< Section > > Sections
Definition: WasmYAML.h:394
FeaturePolicyPrefix Prefix
Definition: WasmYAML.h:133
wasm::WasmInitExpr InitExpr
Definition: WasmYAML.h:74
yaml::BinaryRef Content
Definition: WasmYAML.h:119
#define BCase(X)
std::vector< Import > Imports
Definition: WasmYAML.h:279
std::vector< ProducerEntry > Languages
Definition: WasmYAML.h:246
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:66
const unsigned WASM_SYMBOL_UNDEFINED
Definition: Wasm.h:313
std::vector< SegmentInfo > SegmentInfos
Definition: WasmYAML.h:233
SymbolFlags
Symbol flags.
Definition: Symbol.h:24
std::vector< SymbolInfo > SymbolTable
Definition: WasmYAML.h:232
static void sectionMapping(IO &IO, WasmYAML::DataCountSection &Section)
Definition: WasmYAML.cpp:156
std::vector< Function > Functions
Definition: WasmYAML.h:369
union llvm::wasm::WasmInitExpr::@150 Value
yaml::Hex32 Initial
Definition: WasmYAML.h:49
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
std::vector< ComdatEntry > Entries
Definition: WasmYAML.h:174
This file declares classes for handling the YAML representation of wasm binaries. ...
uint32_t Attribute
Definition: WasmYAML.h:79
yaml::Hex32 Maximum
Definition: WasmYAML.h:50
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
std::vector< Export > Exports
Definition: WasmYAML.h:339
#define BCaseMask(M, X)
std::vector< ProducerEntry > Tools
Definition: WasmYAML.h:247
std::vector< uint32_t > FunctionTypes
Definition: WasmYAML.h:289
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< ProducerEntry > SDKs
Definition: WasmYAML.h:248
#define ECase(X)
ValueType
Value types.
TableType ElemType
Definition: WasmYAML.h:54
std::vector< Table > Tables
Definition: WasmYAML.h:299
LimitFlags Flags
Definition: WasmYAML.h:48
std::vector< ElemSegment > Segments
Definition: WasmYAML.h:359
std::vector< FeatureEntry > Features
Definition: WasmYAML.h:259
std::vector< Event > Events
Definition: WasmYAML.h:329
std::vector< uint32_t > Functions
Definition: WasmYAML.h:67
std::vector< DataSegment > Segments
Definition: WasmYAML.h:379
wasm::WasmDataReference DataRef
Definition: WasmYAML.h:158
std::vector< ValueType > ParamTypes
Definition: WasmYAML.h:147
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
std::vector< LocalDecl > Locals
Definition: WasmYAML.h:103
yaml::BinaryRef Payload
Definition: WasmYAML.h:194
std::vector< NameEntry > FunctionNames
Definition: WasmYAML.h:220
std::vector< Global > Globals
Definition: WasmYAML.h:319
LLVM Value Representation.
Definition: Value.h:72
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:118
static void commonSectionMapping(IO &IO, WasmYAML::Section &Section)
Definition: WasmYAML.cpp:45
const char SectionName[]
Definition: AMDGPUPTNote.h:23
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
SectionType
These are the section type and attributes fields.
Definition: MachO.h:114