LLVM  13.0.0git
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 
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 
62  IO.mapRequired("Name", Section.Name);
63  IO.mapOptional("FunctionNames", Section.FunctionNames);
64  IO.mapOptional("GlobalNames", Section.GlobalNames);
65  IO.mapOptional("DataSegmentNames", Section.DataSegmentNames);
66 }
67 
70  IO.mapRequired("Name", Section.Name);
71  IO.mapRequired("Version", Section.Version);
72  IO.mapOptional("SymbolTable", Section.SymbolTable);
73  IO.mapOptional("SegmentInfo", Section.SegmentInfos);
74  IO.mapOptional("InitFunctions", Section.InitFunctions);
75  IO.mapOptional("Comdats", Section.Comdats);
76 }
77 
80  IO.mapRequired("Name", Section.Name);
81  IO.mapOptional("Languages", Section.Languages);
82  IO.mapOptional("Tools", Section.Tools);
83  IO.mapOptional("SDKs", Section.SDKs);
84 }
85 
88  IO.mapRequired("Name", Section.Name);
89  IO.mapRequired("Features", Section.Features);
90 }
91 
94  IO.mapRequired("Name", Section.Name);
95  IO.mapRequired("Payload", Section.Payload);
96 }
97 
100  IO.mapOptional("Signatures", Section.Signatures);
101 }
102 
105  IO.mapOptional("Imports", Section.Imports);
106 }
107 
110  IO.mapOptional("FunctionTypes", Section.FunctionTypes);
111 }
112 
115  IO.mapOptional("Tables", Section.Tables);
116 }
117 
120  IO.mapOptional("Memories", Section.Memories);
121 }
122 
125  IO.mapOptional("Events", Section.Events);
126 }
127 
130  IO.mapOptional("Globals", Section.Globals);
131 }
132 
135  IO.mapOptional("Exports", Section.Exports);
136 }
137 
140  IO.mapOptional("StartFunction", Section.StartFunction);
141 }
142 
145  IO.mapOptional("Segments", Section.Segments);
146 }
147 
150  IO.mapRequired("Functions", Section.Functions);
151 }
152 
155  IO.mapRequired("Segments", Section.Segments);
156 }
157 
160  IO.mapRequired("Count", Section.Count);
161 }
162 
164  IO &IO, std::unique_ptr<WasmYAML::Section> &Section) {
166  if (IO.outputting())
167  SectionType = Section->Type;
168  else
169  IO.mapRequired("Type", SectionType);
170 
171  switch (SectionType) {
172  case wasm::WASM_SEC_CUSTOM: {
174  if (IO.outputting()) {
175  auto CustomSection = cast<WasmYAML::CustomSection>(Section.get());
176  SectionName = CustomSection->Name;
177  } else {
178  IO.mapRequired("Name", SectionName);
179  }
180  if (SectionName == "dylink") {
181  if (!IO.outputting())
182  Section.reset(new WasmYAML::DylinkSection());
183  sectionMapping(IO, *cast<WasmYAML::DylinkSection>(Section.get()));
184  } else if (SectionName == "linking") {
185  if (!IO.outputting())
186  Section.reset(new WasmYAML::LinkingSection());
187  sectionMapping(IO, *cast<WasmYAML::LinkingSection>(Section.get()));
188  } else if (SectionName == "name") {
189  if (!IO.outputting())
190  Section.reset(new WasmYAML::NameSection());
191  sectionMapping(IO, *cast<WasmYAML::NameSection>(Section.get()));
192  } else if (SectionName == "producers") {
193  if (!IO.outputting())
194  Section.reset(new WasmYAML::ProducersSection());
195  sectionMapping(IO, *cast<WasmYAML::ProducersSection>(Section.get()));
196  } else if (SectionName == "target_features") {
197  if (!IO.outputting())
199  sectionMapping(IO, *cast<WasmYAML::TargetFeaturesSection>(Section.get()));
200  } else {
201  if (!IO.outputting())
203  sectionMapping(IO, *cast<WasmYAML::CustomSection>(Section.get()));
204  }
205  break;
206  }
207  case wasm::WASM_SEC_TYPE:
208  if (!IO.outputting())
209  Section.reset(new WasmYAML::TypeSection());
210  sectionMapping(IO, *cast<WasmYAML::TypeSection>(Section.get()));
211  break;
213  if (!IO.outputting())
214  Section.reset(new WasmYAML::ImportSection());
215  sectionMapping(IO, *cast<WasmYAML::ImportSection>(Section.get()));
216  break;
218  if (!IO.outputting())
219  Section.reset(new WasmYAML::FunctionSection());
220  sectionMapping(IO, *cast<WasmYAML::FunctionSection>(Section.get()));
221  break;
223  if (!IO.outputting())
224  Section.reset(new WasmYAML::TableSection());
225  sectionMapping(IO, *cast<WasmYAML::TableSection>(Section.get()));
226  break;
228  if (!IO.outputting())
229  Section.reset(new WasmYAML::MemorySection());
230  sectionMapping(IO, *cast<WasmYAML::MemorySection>(Section.get()));
231  break;
233  if (!IO.outputting())
234  Section.reset(new WasmYAML::EventSection());
235  sectionMapping(IO, *cast<WasmYAML::EventSection>(Section.get()));
236  break;
238  if (!IO.outputting())
239  Section.reset(new WasmYAML::GlobalSection());
240  sectionMapping(IO, *cast<WasmYAML::GlobalSection>(Section.get()));
241  break;
243  if (!IO.outputting())
244  Section.reset(new WasmYAML::ExportSection());
245  sectionMapping(IO, *cast<WasmYAML::ExportSection>(Section.get()));
246  break;
248  if (!IO.outputting())
249  Section.reset(new WasmYAML::StartSection());
250  sectionMapping(IO, *cast<WasmYAML::StartSection>(Section.get()));
251  break;
252  case wasm::WASM_SEC_ELEM:
253  if (!IO.outputting())
254  Section.reset(new WasmYAML::ElemSection());
255  sectionMapping(IO, *cast<WasmYAML::ElemSection>(Section.get()));
256  break;
257  case wasm::WASM_SEC_CODE:
258  if (!IO.outputting())
259  Section.reset(new WasmYAML::CodeSection());
260  sectionMapping(IO, *cast<WasmYAML::CodeSection>(Section.get()));
261  break;
262  case wasm::WASM_SEC_DATA:
263  if (!IO.outputting())
264  Section.reset(new WasmYAML::DataSection());
265  sectionMapping(IO, *cast<WasmYAML::DataSection>(Section.get()));
266  break;
268  if (!IO.outputting())
269  Section.reset(new WasmYAML::DataCountSection());
270  sectionMapping(IO, *cast<WasmYAML::DataCountSection>(Section.get()));
271  break;
272  default:
273  llvm_unreachable("Unknown section type");
274  }
275 }
276 
278  IO &IO, WasmYAML::SectionType &Type) {
279 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X);
280  ECase(CUSTOM);
281  ECase(TYPE);
282  ECase(IMPORT);
283  ECase(FUNCTION);
284  ECase(TABLE);
285  ECase(MEMORY);
286  ECase(GLOBAL);
287  ECase(EVENT);
288  ECase(EXPORT);
289  ECase(START);
290  ECase(ELEM);
291  ECase(CODE);
292  ECase(DATA);
293  ECase(DATACOUNT);
294 #undef ECase
295 }
296 
298  IO &IO, WasmYAML::Signature &Signature) {
299  IO.mapRequired("Index", Signature.Index);
300  IO.mapRequired("ParamTypes", Signature.ParamTypes);
301  IO.mapRequired("ReturnTypes", Signature.ReturnTypes);
302 }
303 
305  IO.mapRequired("Index", Table.Index);
306  IO.mapRequired("ElemType", Table.ElemType);
307  IO.mapRequired("Limits", Table.TableLimits);
308 }
309 
312  IO.mapRequired("Index", Function.Index);
313  IO.mapRequired("Locals", Function.Locals);
314  IO.mapRequired("Body", Function.Body);
315 }
316 
318  IO &IO, WasmYAML::Relocation &Relocation) {
319  IO.mapRequired("Type", Relocation.Type);
320  IO.mapRequired("Index", Relocation.Index);
321  IO.mapRequired("Offset", Relocation.Offset);
322  IO.mapOptional("Addend", Relocation.Addend, 0);
323 }
324 
326  IO &IO, WasmYAML::NameEntry &NameEntry) {
327  IO.mapRequired("Index", NameEntry.Index);
328  IO.mapRequired("Name", NameEntry.Name);
329 }
330 
332  IO &IO, WasmYAML::ProducerEntry &ProducerEntry) {
333  IO.mapRequired("Name", ProducerEntry.Name);
334  IO.mapRequired("Version", ProducerEntry.Version);
335 }
336 
338  IO &IO, WasmYAML::FeaturePolicyPrefix &Kind) {
339 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_FEATURE_PREFIX_##X);
340  ECase(USED);
341  ECase(REQUIRED);
342  ECase(DISALLOWED);
343 #undef ECase
344 }
345 
347  IO &IO, WasmYAML::FeatureEntry &FeatureEntry) {
348  IO.mapRequired("Prefix", FeatureEntry.Prefix);
349  IO.mapRequired("Name", FeatureEntry.Name);
350 }
351 
353  IO &IO, WasmYAML::SegmentInfo &SegmentInfo) {
354  IO.mapRequired("Index", SegmentInfo.Index);
355  IO.mapRequired("Name", SegmentInfo.Name);
356  IO.mapRequired("Alignment", SegmentInfo.Alignment);
357  IO.mapRequired("Flags", SegmentInfo.Flags);
358 }
359 
361  IO &IO, WasmYAML::LocalDecl &LocalDecl) {
362  IO.mapRequired("Type", LocalDecl.Type);
363  IO.mapRequired("Count", LocalDecl.Count);
364 }
365 
367  WasmYAML::Limits &Limits) {
368  if (!IO.outputting() || Limits.Flags)
369  IO.mapOptional("Flags", Limits.Flags);
370  IO.mapRequired("Initial", Limits.Initial);
371  if (!IO.outputting() || Limits.Flags & wasm::WASM_LIMITS_FLAG_HAS_MAX)
372  IO.mapOptional("Maximum", Limits.Maximum);
373 }
374 
376  IO &IO, WasmYAML::ElemSegment &Segment) {
377  IO.mapRequired("Offset", Segment.Offset);
378  IO.mapRequired("Functions", Segment.Functions);
379 }
380 
382  WasmYAML::Import &Import) {
383  IO.mapRequired("Module", Import.Module);
384  IO.mapRequired("Field", Import.Field);
385  IO.mapRequired("Kind", Import.Kind);
386  if (Import.Kind == wasm::WASM_EXTERNAL_FUNCTION) {
387  IO.mapRequired("SigIndex", Import.SigIndex);
388  } else if (Import.Kind == wasm::WASM_EXTERNAL_GLOBAL) {
389  IO.mapRequired("GlobalType", Import.GlobalImport.Type);
390  IO.mapRequired("GlobalMutable", Import.GlobalImport.Mutable);
391  } else if (Import.Kind == wasm::WASM_EXTERNAL_EVENT) {
392  IO.mapRequired("EventAttribute", Import.EventImport.Attribute);
393  IO.mapRequired("EventSigIndex", Import.EventImport.SigIndex);
394  } else if (Import.Kind == wasm::WASM_EXTERNAL_TABLE) {
395  IO.mapRequired("Table", Import.TableImport);
396  } else if (Import.Kind == wasm::WASM_EXTERNAL_MEMORY) {
397  IO.mapRequired("Memory", Import.Memory);
398  } else {
399  llvm_unreachable("unhandled import type");
400  }
401 }
402 
404  WasmYAML::Export &Export) {
405  IO.mapRequired("Name", Export.Name);
406  IO.mapRequired("Kind", Export.Kind);
407  IO.mapRequired("Index", Export.Index);
408 }
409 
411  WasmYAML::Global &Global) {
412  IO.mapRequired("Index", Global.Index);
413  IO.mapRequired("Type", Global.Type);
414  IO.mapRequired("Mutable", Global.Mutable);
415  IO.mapRequired("InitExpr", Global.InitExpr);
416 }
417 
419  wasm::WasmInitExpr &Expr) {
420  WasmYAML::Opcode Op = Expr.Opcode;
421  IO.mapRequired("Opcode", Op);
422  Expr.Opcode = Op;
423  switch (Expr.Opcode) {
425  IO.mapRequired("Value", Expr.Value.Int32);
426  break;
428  IO.mapRequired("Value", Expr.Value.Int64);
429  break;
431  IO.mapRequired("Value", Expr.Value.Float32);
432  break;
434  IO.mapRequired("Value", Expr.Value.Float64);
435  break;
437  IO.mapRequired("Index", Expr.Value.Global);
438  break;
441  IO.mapRequired("Type", Ty);
442  break;
443  }
444  }
445 }
446 
448  IO &IO, WasmYAML::DataSegment &Segment) {
449  IO.mapOptional("SectionOffset", Segment.SectionOffset);
450  IO.mapRequired("InitFlags", Segment.InitFlags);
452  IO.mapRequired("MemoryIndex", Segment.MemoryIndex);
453  } else {
454  Segment.MemoryIndex = 0;
455  }
456  if ((Segment.InitFlags & wasm::WASM_DATA_SEGMENT_IS_PASSIVE) == 0) {
457  IO.mapRequired("Offset", Segment.Offset);
458  } else {
460  Segment.Offset.Value.Int32 = 0;
461  }
462  IO.mapRequired("Content", Segment.Content);
463 }
464 
466  IO &IO, WasmYAML::InitFunction &Init) {
467  IO.mapRequired("Priority", Init.Priority);
468  IO.mapRequired("Symbol", Init.Symbol);
469 }
470 
472  IO &IO, WasmYAML::ComdatKind &Kind) {
473 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_COMDAT_##X);
474  ECase(FUNCTION);
475  ECase(DATA);
476  ECase(SECTION);
477 #undef ECase
478 }
479 
481  IO &IO, WasmYAML::ComdatEntry &ComdatEntry) {
482  IO.mapRequired("Kind", ComdatEntry.Kind);
483  IO.mapRequired("Index", ComdatEntry.Index);
484 }
485 
488  IO.mapRequired("Name", Comdat.Name);
489  IO.mapRequired("Entries", Comdat.Entries);
490 }
491 
494  IO.mapRequired("Index", Info.Index);
495  IO.mapRequired("Kind", Info.Kind);
497  IO.mapRequired("Name", Info.Name);
498  IO.mapRequired("Flags", Info.Flags);
500  IO.mapRequired("Function", Info.ElementIndex);
501  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_GLOBAL) {
502  IO.mapRequired("Global", Info.ElementIndex);
503  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_TABLE) {
504  IO.mapRequired("Table", Info.ElementIndex);
505  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_EVENT) {
506  IO.mapRequired("Event", Info.ElementIndex);
507  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_DATA) {
508  if ((Info.Flags & wasm::WASM_SYMBOL_UNDEFINED) == 0) {
509  IO.mapRequired("Segment", Info.DataRef.Segment);
510  IO.mapOptional("Offset", Info.DataRef.Offset, 0u);
511  IO.mapRequired("Size", Info.DataRef.Size);
512  }
513  } else if (Info.Kind == wasm::WASM_SYMBOL_TYPE_SECTION) {
514  IO.mapRequired("Section", Info.ElementIndex);
515  } else {
516  llvm_unreachable("unsupported symbol kind");
517  }
518 }
519 
521  IO.mapRequired("Index", Event.Index);
522  IO.mapRequired("Attribute", Event.Attribute);
523  IO.mapRequired("SigIndex", Event.SigIndex);
524 }
525 
527  IO &IO, WasmYAML::LimitFlags &Value) {
528 #define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_LIMITS_FLAG_##X)
529  BCase(HAS_MAX);
530  BCase(IS_SHARED);
531  BCase(IS_64);
532 #undef BCase
533 }
534 
536  IO &IO, WasmYAML::SegmentFlags &Value) {}
537 
539  IO &IO, WasmYAML::SymbolFlags &Value) {
540 #define BCaseMask(M, X) \
541  IO.maskedBitSetCase(Value, #X, wasm::WASM_SYMBOL_##X, wasm::WASM_SYMBOL_##M)
542  // BCaseMask(BINDING_MASK, BINDING_GLOBAL);
543  BCaseMask(BINDING_MASK, BINDING_WEAK);
544  BCaseMask(BINDING_MASK, BINDING_LOCAL);
545  // BCaseMask(VISIBILITY_MASK, VISIBILITY_DEFAULT);
546  BCaseMask(VISIBILITY_MASK, VISIBILITY_HIDDEN);
547  BCaseMask(UNDEFINED, UNDEFINED);
548  BCaseMask(EXPORTED, EXPORTED);
549  BCaseMask(EXPLICIT_NAME, EXPLICIT_NAME);
550  BCaseMask(NO_STRIP, NO_STRIP);
551 #undef BCaseMask
552 }
553 
555  IO &IO, WasmYAML::SymbolKind &Kind) {
556 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_SYMBOL_TYPE_##X);
557  ECase(FUNCTION);
558  ECase(DATA);
559  ECase(GLOBAL);
560  ECase(TABLE);
561  ECase(SECTION);
562  ECase(EVENT);
563 #undef ECase
564 }
565 
567  IO &IO, WasmYAML::ValueType &Type) {
568 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
569  ECase(I32);
570  ECase(I64);
571  ECase(F32);
572  ECase(F64);
573  ECase(V128);
574  ECase(FUNCREF);
575  ECase(EXTERNREF);
576  ECase(FUNC);
577 #undef ECase
578 }
579 
581  IO &IO, WasmYAML::ExportKind &Kind) {
582 #define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X);
583  ECase(FUNCTION);
584  ECase(TABLE);
585  ECase(MEMORY);
586  ECase(GLOBAL);
587  ECase(EVENT);
588 #undef ECase
589 }
590 
592  IO &IO, WasmYAML::Opcode &Code) {
593 #define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X);
594  ECase(END);
595  ECase(I32_CONST);
596  ECase(I64_CONST);
597  ECase(F64_CONST);
598  ECase(F32_CONST);
599  ECase(GLOBAL_GET);
600  ECase(REF_NULL);
601 #undef ECase
602 }
603 
605  IO &IO, WasmYAML::TableType &Type) {
606 #define ECase(X) IO.enumCase(Type, #X, wasm::WASM_TYPE_##X);
607  ECase(FUNCREF);
608  ECase(EXTERNREF);
609 #undef ECase
610 }
611 
613  IO &IO, WasmYAML::RelocType &Type) {
614 #define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);
615 #include "llvm/BinaryFormat/WasmRelocs.def"
616 #undef WASM_RELOC
617  IO.enumFallback<Hex32>(Type);
618 }
619 
620 } // end namespace yaml
621 
622 } // end namespace llvm
llvm::EngineKind::Kind
Kind
Definition: ExecutionEngine.h:524
llvm::wasm::WASM_SYMBOL_TYPE_SECTION
@ WASM_SYMBOL_TYPE_SECTION
Definition: Wasm.h:346
llvm::wasm::WASM_EXTERNAL_GLOBAL
@ WASM_EXTERNAL_GLOBAL
Definition: Wasm.h:260
llvm::WasmYAML::GlobalSection
Definition: WasmYAML.h:327
llvm::WasmYAML::FileHeader
Definition: WasmYAML.h:43
llvm::wasm::WASM_SEC_TABLE
@ WASM_SEC_TABLE
Definition: Wasm.h:230
llvm::WasmYAML::ProducerEntry::Name
std::string Name
Definition: WasmYAML.h:131
llvm::WasmYAML::FeatureEntry::Name
std::string Name
Definition: WasmYAML.h:137
llvm::WasmYAML::InitFunction
Definition: WasmYAML.h:165
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::WasmYAML::Section::~Section
virtual ~Section()
llvm::yaml::ScalarEnumerationTraits< WasmYAML::FeaturePolicyPrefix >::enumeration
static void enumeration(IO &IO, WasmYAML::FeaturePolicyPrefix &Prefix)
Definition: WasmYAML.cpp:337
llvm::WasmYAML::ProducersSection
Definition: WasmYAML.h:243
llvm::WasmYAML::NameEntry::Index
uint32_t Index
Definition: WasmYAML.h:126
llvm::WasmYAML::FileHeader::Version
yaml::Hex32 Version
Definition: WasmYAML.h:44
llvm::yaml::ScalarEnumerationTraits< WasmYAML::TableType >::enumeration
static void enumeration(IO &IO, WasmYAML::TableType &Type)
Definition: WasmYAML.cpp:604
llvm::WasmYAML::LocalDecl
Definition: WasmYAML.h:97
llvm::yaml::ScalarEnumerationTraits< WasmYAML::ValueType >::enumeration
static void enumeration(IO &IO, WasmYAML::ValueType &Type)
Definition: WasmYAML.cpp:566
llvm::Function
Definition: Function.h:61
StringRef.h
llvm::yaml::ScalarEnumerationTraits< WasmYAML::Opcode >::enumeration
static void enumeration(IO &IO, WasmYAML::Opcode &Opcode)
Definition: WasmYAML.cpp:591
llvm::WasmYAML::Comdat
Definition: WasmYAML.h:175
llvm::codeview::SymbolKind
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
llvm::yaml::ScalarEnumerationTraits< WasmYAML::SectionType >::enumeration
static void enumeration(IO &IO, WasmYAML::SectionType &Type)
Definition: WasmYAML.cpp:277
llvm::wasm::WASM_SEC_GLOBAL
@ WASM_SEC_GLOBAL
Definition: Wasm.h:232
ErrorHandling.h
llvm::wasm::WASM_SEC_START
@ WASM_SEC_START
Definition: Wasm.h:234
llvm::wasm::WASM_SYMBOL_TYPE_TABLE
@ WASM_SYMBOL_TYPE_TABLE
Definition: Wasm.h:348
llvm::wasm::WASM_SYMBOL_TYPE_GLOBAL
@ WASM_SYMBOL_TYPE_GLOBAL
Definition: Wasm.h:345
llvm::WasmYAML::DataSection
Definition: WasmYAML.h:377
llvm::WasmYAML::DataSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:121
llvm::yaml::ScalarEnumerationTraits< WasmYAML::ExportKind >::enumeration
static void enumeration(IO &IO, WasmYAML::ExportKind &Kind)
Definition: WasmYAML.cpp:580
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::WasmYAML::TableSection
Definition: WasmYAML.h:297
llvm::wasm::WASM_SEC_IMPORT
@ WASM_SEC_IMPORT
Definition: Wasm.h:228
llvm::WasmYAML::ElemSection
Definition: WasmYAML.h:357
llvm::WasmYAML::SegmentInfo::Name
StringRef Name
Definition: WasmYAML.h:142
llvm::wasm::WASM_SYMBOL_UNDEFINED
const unsigned WASM_SYMBOL_UNDEFINED
Definition: Wasm.h:364
llvm::WasmYAML::ElemSegment
Definition: WasmYAML.h:65
llvm::WasmYAML::Relocation::Offset
yaml::Hex32 Offset
Definition: WasmYAML.h:113
llvm::WasmYAML::Event
Definition: WasmYAML.h:78
llvm::WasmYAML::MemorySection
Definition: WasmYAML.h:307
llvm::wasm::WASM_SEC_MEMORY
@ WASM_SEC_MEMORY
Definition: Wasm.h:231
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:50
llvm::WasmYAML::ProducerEntry
Definition: WasmYAML.h:130
llvm::MachO::SymbolFlags
SymbolFlags
Symbol flags.
Definition: Symbol.h:25
llvm::wasm::WASM_SEC_EXPORT
@ WASM_SEC_EXPORT
Definition: Wasm.h:233
llvm::wasm::WASM_OPCODE_I64_CONST
@ WASM_OPCODE_I64_CONST
Definition: Wasm.h:275
llvm::WasmYAML::Import
Definition: WasmYAML.h:84
llvm::WasmYAML::CustomSection
Definition: WasmYAML.h:188
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::WasmYAML::ProducerEntry::Version
std::string Version
Definition: WasmYAML.h:132
llvm::WasmYAML::ComdatEntry::Index
uint32_t Index
Definition: WasmYAML.h:172
llvm::wasm::WASM_SEC_CODE
@ WASM_SEC_CODE
Definition: Wasm.h:236
llvm::WasmYAML::SegmentInfo::Index
uint32_t Index
Definition: WasmYAML.h:141
llvm::wasm::WasmInitExpr::Global
uint32_t Global
Definition: Wasm.h:88
llvm::WasmYAML::NameSection
Definition: WasmYAML.h:215
llvm::WasmYAML::DataSegment::Content
yaml::BinaryRef Content
Definition: WasmYAML.h:122
llvm::wasm::WASM_OPCODE_I32_CONST
@ WASM_OPCODE_I32_CONST
Definition: Wasm.h:274
llvm::WasmYAML::Section
Definition: WasmYAML.h:180
llvm::WasmYAML::Relocation::Type
RelocType Type
Definition: WasmYAML.h:109
llvm::WasmYAML::FunctionSection
Definition: WasmYAML.h:287
llvm::wasm::WasmInitExpr::Float64
uint64_t Float64
Definition: Wasm.h:87
llvm::WasmYAML::Limits::Maximum
yaml::Hex32 Maximum
Definition: WasmYAML.h:50
llvm::wasm::WasmInitExpr::Int64
int64_t Int64
Definition: Wasm.h:85
llvm::yaml::ScalarBitSetTraits< WasmYAML::SymbolFlags >::bitset
static void bitset(IO &IO, WasmYAML::SymbolFlags &Value)
Definition: WasmYAML.cpp:538
llvm::WasmYAML::ComdatEntry
Definition: WasmYAML.h:170
llvm::WasmYAML::Signature::ReturnTypes
std::vector< ValueType > ReturnTypes
Definition: WasmYAML.h:151
llvm::WasmYAML::CodeSection
Definition: WasmYAML.h:367
llvm::WasmYAML::NameEntry
Definition: WasmYAML.h:125
llvm::WasmYAML::Table::TableLimits
Limits TableLimits
Definition: WasmYAML.h:55
llvm::AMDGPU::ElfNote::SectionName
const char SectionName[]
Definition: AMDGPUPTNote.h:24
llvm::WasmYAML::SegmentInfo::Flags
SegmentFlags Flags
Definition: WasmYAML.h:144
llvm::wasm::WASM_SYMBOL_TYPE_FUNCTION
@ WASM_SYMBOL_TYPE_FUNCTION
Definition: Wasm.h:343
llvm::WasmYAML::SymbolInfo
Definition: WasmYAML.h:154
llvm::WasmYAML::Function
Definition: WasmYAML.h:102
llvm::wasm::WASM_OPCODE_REF_NULL
@ WASM_OPCODE_REF_NULL
Definition: Wasm.h:280
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:26
llvm::WasmYAML::Limits
Definition: WasmYAML.h:47
llvm::wasm::WASM_SEC_ELEM
@ WASM_SEC_ELEM
Definition: Wasm.h:235
llvm::WasmYAML::EventSection
Definition: WasmYAML.h:317
llvm::Comdat
Definition: Comdat.h:31
llvm::wasm::WASM_SEC_DATACOUNT
@ WASM_SEC_DATACOUNT
Definition: Wasm.h:238
llvm::PassSummaryAction::Import
@ Import
Import information from summary.
llvm::WasmYAML::ExportSection
Definition: WasmYAML.h:337
llvm::wasm::WasmInitExpr::Float32
uint32_t Float32
Definition: Wasm.h:86
llvm::WasmYAML::Signature::Index
uint32_t Index
Definition: WasmYAML.h:148
llvm::WasmYAML::ElemSegment::Functions
std::vector< uint32_t > Functions
Definition: WasmYAML.h:68
llvm::wasm::WasmInitExpr::Value
union llvm::wasm::WasmInitExpr::@157 Value
llvm::WasmYAML::SegmentInfo
Definition: WasmYAML.h:140
llvm::OutputFileType::Object
@ Object
WasmYAML.h
llvm::WasmYAML::Relocation::Index
uint32_t Index
Definition: WasmYAML.h:110
ECase
#define ECase(X)
llvm::wasm::WASM_OPCODE_GLOBAL_GET
@ WASM_OPCODE_GLOBAL_GET
Definition: Wasm.h:270
llvm::DepClassTy::REQUIRED
@ REQUIRED
llvm::WasmYAML::Table::Index
uint32_t Index
Definition: WasmYAML.h:56
llvm::WasmYAML::Table
Definition: WasmYAML.h:53
llvm::WasmYAML::StartSection
Definition: WasmYAML.h:347
llvm::wasm::WASM_SEC_EVENT
@ WASM_SEC_EVENT
Definition: Wasm.h:239
llvm::SectionName::Name
StringRef Name
Definition: DWARFSection.h:21
llvm::WasmYAML::TargetFeaturesSection
Definition: WasmYAML.h:256
llvm::WasmYAML::ElemSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:67
llvm::yaml::ScalarBitSetTraits< WasmYAML::SegmentFlags >::bitset
static void bitset(IO &IO, WasmYAML::SegmentFlags &Value)
Definition: WasmYAML.cpp:535
llvm::AMDGPU::HSAMD::ValueType
ValueType
Value types.
Definition: AMDGPUMetadata.h:85
llvm::WasmYAML::FeatureEntry
Definition: WasmYAML.h:135
llvm::wasm::WASM_TYPE_EXTERNREF
@ WASM_TYPE_EXTERNREF
Definition: Wasm.h:250
llvm::WasmYAML::Table::ElemType
TableType ElemType
Definition: WasmYAML.h:54
llvm::wasm::WASM_OPCODE_F64_CONST
@ WASM_OPCODE_F64_CONST
Definition: Wasm.h:277
llvm::WasmYAML::FeatureEntry::Prefix
FeaturePolicyPrefix Prefix
Definition: WasmYAML.h:136
llvm::yaml::ScalarEnumerationTraits< WasmYAML::ComdatKind >::enumeration
static void enumeration(IO &IO, WasmYAML::ComdatKind &Kind)
Definition: WasmYAML.cpp:471
llvm::wasm::WASM_SEC_TYPE
@ WASM_SEC_TYPE
Definition: Wasm.h:227
llvm::yaml::sectionMapping
static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section)
Definition: ELFYAML.cpp:1223
llvm::wasm::WASM_DATA_SEGMENT_IS_PASSIVE
@ WASM_DATA_SEGMENT_IS_PASSIVE
Definition: Wasm.h:306
BCase
#define BCase(X)
YAMLTraits.h
llvm::wasm::WasmInitExpr::Int32
int32_t Int32
Definition: Wasm.h:84
llvm::WasmYAML::Signature
Definition: WasmYAML.h:147
llvm::WasmYAML::ComdatEntry::Kind
ComdatKind Kind
Definition: WasmYAML.h:171
llvm::wasm::WASM_SEC_DATA
@ WASM_SEC_DATA
Definition: Wasm.h:237
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::WasmYAML::Event::SigIndex
uint32_t SigIndex
Definition: WasmYAML.h:81
llvm::WasmYAML::Relocation::Addend
int64_t Addend
Definition: WasmYAML.h:114
llvm::wasm::WASM_SYMBOL_TYPE_EVENT
@ WASM_SYMBOL_TYPE_EVENT
Definition: Wasm.h:347
llvm::yaml::commonSectionMapping
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
Definition: ELFYAML.cpp:1196
llvm::WasmYAML::LocalDecl::Count
uint32_t Count
Definition: WasmYAML.h:99
llvm::WasmYAML::Relocation
Definition: WasmYAML.h:108
llvm::WasmYAML::Event::Index
uint32_t Index
Definition: WasmYAML.h:79
llvm::Init
Definition: Record.h:271
llvm::WasmYAML::Object
Definition: WasmYAML.h:397
llvm::wasm::WASM_SEC_FUNCTION
@ WASM_SEC_FUNCTION
Definition: Wasm.h:229
llvm::WasmYAML::DataCountSection
Definition: WasmYAML.h:387
llvm::WasmYAML::Event::Attribute
uint32_t Attribute
Definition: WasmYAML.h:80
llvm::WasmYAML::DataSegment::InitFlags
uint32_t InitFlags
Definition: WasmYAML.h:119
llvm::wasm::WASM_OPCODE_F32_CONST
@ WASM_OPCODE_F32_CONST
Definition: Wasm.h:276
llvm::WasmYAML::DataSegment
Definition: WasmYAML.h:117
llvm::wasm::WASM_DATA_SEGMENT_HAS_MEMINDEX
@ WASM_DATA_SEGMENT_HAS_MEMINDEX
Definition: Wasm.h:307
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:302
llvm::WasmYAML::DataSegment::MemoryIndex
uint32_t MemoryIndex
Definition: WasmYAML.h:120
llvm::WasmYAML::Limits::Flags
LimitFlags Flags
Definition: WasmYAML.h:48
llvm::WasmYAML::SegmentInfo::Alignment
uint32_t Alignment
Definition: WasmYAML.h:143
llvm::SectionName
Definition: DWARFSection.h:20
llvm::wasm::WASM_SEC_CUSTOM
@ WASM_SEC_CUSTOM
Definition: Wasm.h:226
Casting.h
llvm::WasmYAML::LinkingSection
Definition: WasmYAML.h:228
llvm::WasmYAML::Global
Definition: WasmYAML.h:71
llvm::wasm::WASM_LIMITS_FLAG_HAS_MAX
@ WASM_LIMITS_FLAG_HAS_MAX
Definition: Wasm.h:300
llvm::yaml::ScalarEnumerationTraits< WasmYAML::RelocType >::enumeration
static void enumeration(IO &IO, WasmYAML::RelocType &Kind)
Definition: WasmYAML.cpp:612
llvm::wasm::WasmInitExpr
Definition: Wasm.h:81
llvm::yaml::ScalarBitSetTraits< WasmYAML::LimitFlags >::bitset
static void bitset(IO &IO, WasmYAML::LimitFlags &Value)
Definition: WasmYAML.cpp:526
llvm::WasmYAML::NameEntry::Name
StringRef Name
Definition: WasmYAML.h:127
llvm::WasmYAML::Export
Definition: WasmYAML.h:59
BCaseMask
#define BCaseMask(M, X)
llvm::WasmYAML::TypeSection
Definition: WasmYAML.h:267
llvm::wasm::WASM_EXTERNAL_FUNCTION
@ WASM_EXTERNAL_FUNCTION
Definition: Wasm.h:257
llvm::yaml::ScalarEnumerationTraits< WasmYAML::SymbolKind >::enumeration
static void enumeration(IO &IO, WasmYAML::SymbolKind &Kind)
Definition: WasmYAML.cpp:554
llvm::wasm::WASM_EXTERNAL_MEMORY
@ WASM_EXTERNAL_MEMORY
Definition: Wasm.h:259
llvm::WasmYAML::Signature::ParamTypes
std::vector< ValueType > ParamTypes
Definition: WasmYAML.h:150
llvm::WasmYAML::Limits::Initial
yaml::Hex32 Initial
Definition: WasmYAML.h:49
llvm::wasm::WasmInitExpr::Opcode
uint8_t Opcode
Definition: Wasm.h:82
llvm::WasmYAML::LocalDecl::Type
ValueType Type
Definition: WasmYAML.h:98
llvm::WasmYAML::DataSegment::SectionOffset
uint32_t SectionOffset
Definition: WasmYAML.h:118
llvm::WasmYAML::ImportSection
Definition: WasmYAML.h:277
llvm::wasm::WASM_EXTERNAL_EVENT
@ WASM_EXTERNAL_EVENT
Definition: Wasm.h:261
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::wasm::WASM_SYMBOL_TYPE_DATA
@ WASM_SYMBOL_TYPE_DATA
Definition: Wasm.h:344
llvm::wasm::WASM_EXTERNAL_TABLE
@ WASM_EXTERNAL_TABLE
Definition: Wasm.h:258
llvm::MachO::SectionType
SectionType
These are the section type and attributes fields.
Definition: MachO.h:120