LLVM  14.0.0git
WasmYAML.h
Go to the documentation of this file.
1 //===- WasmYAML.h - Wasm YAMLIO implementation ------------------*- C++ -*-===//
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 /// \file
10 /// This file declares classes for handling the YAML representation
11 /// of wasm binaries.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_OBJECTYAML_WASMYAML_H
16 #define LLVM_OBJECTYAML_WASMYAML_H
17 
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/BinaryFormat/Wasm.h"
20 #include "llvm/ObjectYAML/YAML.h"
21 #include "llvm/Support/Casting.h"
22 #include <cstdint>
23 #include <memory>
24 #include <vector>
25 
26 namespace llvm {
27 namespace WasmYAML {
28 
32 LLVM_YAML_STRONG_TYPEDEF(uint32_t, SignatureForm)
41 LLVM_YAML_STRONG_TYPEDEF(uint32_t, FeaturePolicyPrefix)
42 
43 struct FileHeader {
44  yaml::Hex32 Version;
45 };
46 
47 struct Limits {
48  LimitFlags Flags;
49  yaml::Hex32 Minimum;
50  yaml::Hex32 Maximum;
51 };
52 
53 struct Table {
54  TableType ElemType;
57 };
58 
59 struct Export {
61  ExportKind Kind;
63 };
64 
65 struct ElemSegment {
70  std::vector<uint32_t> Functions;
71 };
72 
73 struct Global {
76  bool Mutable;
78 };
79 
80 struct Tag {
84 };
85 
86 struct Import {
89  ExportKind Kind;
90  union {
96  };
97 };
98 
99 struct LocalDecl {
102 };
103 
104 struct Function {
106  std::vector<LocalDecl> Locals;
108 };
109 
110 struct Relocation {
111  RelocType Type;
113  // TODO(wvo): this would strictly be better as Hex64, but that will change
114  // all existing obj2yaml output.
115  yaml::Hex32 Offset;
116  int64_t Addend;
117 };
118 
119 struct DataSegment {
125 };
126 
127 struct NameEntry {
130 };
131 
133  std::string Name;
134  std::string Version;
135 };
136 
137 struct FeatureEntry {
138  FeaturePolicyPrefix Prefix;
139  std::string Name;
140 };
141 
142 struct SegmentInfo {
146  SegmentFlags Flags;
147 };
148 
149 struct Signature {
151  SignatureForm Form = wasm::WASM_TYPE_FUNC;
152  std::vector<ValueType> ParamTypes;
153  std::vector<ValueType> ReturnTypes;
154 };
155 
156 struct SymbolInfo {
161  union {
164  };
165 };
166 
167 struct InitFunction {
170 };
171 
172 struct ComdatEntry {
173  ComdatKind Kind;
175 };
176 
177 struct Comdat {
179  std::vector<ComdatEntry> Entries;
180 };
181 
182 struct Section {
184  virtual ~Section();
185 
187  std::vector<Relocation> Relocations;
188 };
189 
192  : Section(wasm::WASM_SEC_CUSTOM), Name(Name) {}
193 
194  static bool classof(const Section *S) {
195  return S->Type == wasm::WASM_SEC_CUSTOM;
196  }
197 
200 };
201 
202 struct DylinkExport {
205 };
206 
208  DylinkSection() : CustomSection("dylink.0") {}
209 
210  static bool classof(const Section *S) {
211  auto C = dyn_cast<CustomSection>(S);
212  return C && C->Name == "dylink.0";
213  }
214 
219  std::vector<StringRef> Needed;
220  std::vector<DylinkExport> ExportInfo;
221 };
222 
224  NameSection() : CustomSection("name") {}
225 
226  static bool classof(const Section *S) {
227  auto C = dyn_cast<CustomSection>(S);
228  return C && C->Name == "name";
229  }
230 
231  std::vector<NameEntry> FunctionNames;
232  std::vector<NameEntry> GlobalNames;
233  std::vector<NameEntry> DataSegmentNames;
234 };
235 
237  LinkingSection() : CustomSection("linking") {}
238 
239  static bool classof(const Section *S) {
240  auto C = dyn_cast<CustomSection>(S);
241  return C && C->Name == "linking";
242  }
243 
245  std::vector<SymbolInfo> SymbolTable;
246  std::vector<SegmentInfo> SegmentInfos;
247  std::vector<InitFunction> InitFunctions;
248  std::vector<Comdat> Comdats;
249 };
250 
252  ProducersSection() : CustomSection("producers") {}
253 
254  static bool classof(const Section *S) {
255  auto C = dyn_cast<CustomSection>(S);
256  return C && C->Name == "producers";
257  }
258 
259  std::vector<ProducerEntry> Languages;
260  std::vector<ProducerEntry> Tools;
261  std::vector<ProducerEntry> SDKs;
262 };
263 
265  TargetFeaturesSection() : CustomSection("target_features") {}
266 
267  static bool classof(const Section *S) {
268  auto C = dyn_cast<CustomSection>(S);
269  return C && C->Name == "target_features";
270  }
271 
272  std::vector<FeatureEntry> Features;
273 };
274 
277 
278  static bool classof(const Section *S) {
279  return S->Type == wasm::WASM_SEC_TYPE;
280  }
281 
282  std::vector<Signature> Signatures;
283 };
284 
287 
288  static bool classof(const Section *S) {
289  return S->Type == wasm::WASM_SEC_IMPORT;
290  }
291 
292  std::vector<Import> Imports;
293 };
294 
297 
298  static bool classof(const Section *S) {
299  return S->Type == wasm::WASM_SEC_FUNCTION;
300  }
301 
302  std::vector<uint32_t> FunctionTypes;
303 };
304 
307 
308  static bool classof(const Section *S) {
309  return S->Type == wasm::WASM_SEC_TABLE;
310  }
311 
312  std::vector<Table> Tables;
313 };
314 
317 
318  static bool classof(const Section *S) {
319  return S->Type == wasm::WASM_SEC_MEMORY;
320  }
321 
322  std::vector<Limits> Memories;
323 };
324 
325 struct TagSection : Section {
327 
328  static bool classof(const Section *S) {
329  return S->Type == wasm::WASM_SEC_TAG;
330  }
331 
332  std::vector<Tag> Tags;
333 };
334 
337 
338  static bool classof(const Section *S) {
339  return S->Type == wasm::WASM_SEC_GLOBAL;
340  }
341 
342  std::vector<Global> Globals;
343 };
344 
347 
348  static bool classof(const Section *S) {
349  return S->Type == wasm::WASM_SEC_EXPORT;
350  }
351 
352  std::vector<Export> Exports;
353 };
354 
357 
358  static bool classof(const Section *S) {
359  return S->Type == wasm::WASM_SEC_START;
360  }
361 
363 };
364 
367 
368  static bool classof(const Section *S) {
369  return S->Type == wasm::WASM_SEC_ELEM;
370  }
371 
372  std::vector<ElemSegment> Segments;
373 };
374 
377 
378  static bool classof(const Section *S) {
379  return S->Type == wasm::WASM_SEC_CODE;
380  }
381 
382  std::vector<Function> Functions;
383 };
384 
387 
388  static bool classof(const Section *S) {
389  return S->Type == wasm::WASM_SEC_DATA;
390  }
391 
392  std::vector<DataSegment> Segments;
393 };
394 
397 
398  static bool classof(const Section *S) {
399  return S->Type == wasm::WASM_SEC_DATACOUNT;
400  }
401 
403 };
404 
405 struct Object {
407  std::vector<std::unique_ptr<Section>> Sections;
408 };
409 
410 } // end namespace WasmYAML
411 } // end namespace llvm
412 
413 LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<llvm::WasmYAML::Section>)
436 
437 namespace llvm {
438 namespace yaml {
439 
440 template <> struct MappingTraits<WasmYAML::FileHeader> {
441  static void mapping(IO &IO, WasmYAML::FileHeader &FileHdr);
442 };
443 
444 template <> struct MappingTraits<std::unique_ptr<WasmYAML::Section>> {
445  static void mapping(IO &IO, std::unique_ptr<WasmYAML::Section> &Section);
446 };
447 
448 template <> struct MappingTraits<WasmYAML::Object> {
449  static void mapping(IO &IO, WasmYAML::Object &Object);
450 };
451 
452 template <> struct MappingTraits<WasmYAML::Import> {
453  static void mapping(IO &IO, WasmYAML::Import &Import);
454 };
455 
456 template <> struct MappingTraits<WasmYAML::Export> {
457  static void mapping(IO &IO, WasmYAML::Export &Export);
458 };
459 
460 template <> struct MappingTraits<WasmYAML::Global> {
461  static void mapping(IO &IO, WasmYAML::Global &Global);
462 };
463 
464 template <> struct ScalarBitSetTraits<WasmYAML::LimitFlags> {
465  static void bitset(IO &IO, WasmYAML::LimitFlags &Value);
466 };
467 
468 template <> struct ScalarBitSetTraits<WasmYAML::SymbolFlags> {
469  static void bitset(IO &IO, WasmYAML::SymbolFlags &Value);
470 };
471 
472 template <> struct ScalarEnumerationTraits<WasmYAML::SymbolKind> {
473  static void enumeration(IO &IO, WasmYAML::SymbolKind &Kind);
474 };
475 
476 template <> struct ScalarBitSetTraits<WasmYAML::SegmentFlags> {
477  static void bitset(IO &IO, WasmYAML::SegmentFlags &Value);
478 };
479 
480 template <> struct ScalarEnumerationTraits<WasmYAML::SectionType> {
481  static void enumeration(IO &IO, WasmYAML::SectionType &Type);
482 };
483 
484 template <> struct MappingTraits<WasmYAML::Signature> {
485  static void mapping(IO &IO, WasmYAML::Signature &Signature);
486 };
487 
488 template <> struct MappingTraits<WasmYAML::Table> {
489  static void mapping(IO &IO, WasmYAML::Table &Table);
490 };
491 
492 template <> struct MappingTraits<WasmYAML::Limits> {
493  static void mapping(IO &IO, WasmYAML::Limits &Limits);
494 };
495 
496 template <> struct MappingTraits<WasmYAML::Function> {
497  static void mapping(IO &IO, WasmYAML::Function &Function);
498 };
499 
500 template <> struct MappingTraits<WasmYAML::Relocation> {
501  static void mapping(IO &IO, WasmYAML::Relocation &Relocation);
502 };
503 
504 template <> struct MappingTraits<WasmYAML::NameEntry> {
505  static void mapping(IO &IO, WasmYAML::NameEntry &NameEntry);
506 };
507 
508 template <> struct MappingTraits<WasmYAML::ProducerEntry> {
509  static void mapping(IO &IO, WasmYAML::ProducerEntry &ProducerEntry);
510 };
511 
512 template <> struct ScalarEnumerationTraits<WasmYAML::FeaturePolicyPrefix> {
513  static void enumeration(IO &IO, WasmYAML::FeaturePolicyPrefix &Prefix);
514 };
515 
516 template <> struct MappingTraits<WasmYAML::FeatureEntry> {
517  static void mapping(IO &IO, WasmYAML::FeatureEntry &FeatureEntry);
518 };
519 
520 template <> struct MappingTraits<WasmYAML::SegmentInfo> {
521  static void mapping(IO &IO, WasmYAML::SegmentInfo &SegmentInfo);
522 };
523 
524 template <> struct MappingTraits<WasmYAML::LocalDecl> {
525  static void mapping(IO &IO, WasmYAML::LocalDecl &LocalDecl);
526 };
527 
528 template <> struct MappingTraits<wasm::WasmInitExpr> {
529  static void mapping(IO &IO, wasm::WasmInitExpr &Expr);
530 };
531 
532 template <> struct MappingTraits<WasmYAML::DataSegment> {
533  static void mapping(IO &IO, WasmYAML::DataSegment &Segment);
534 };
535 
536 template <> struct MappingTraits<WasmYAML::ElemSegment> {
537  static void mapping(IO &IO, WasmYAML::ElemSegment &Segment);
538 };
539 
540 template <> struct MappingTraits<WasmYAML::SymbolInfo> {
541  static void mapping(IO &IO, WasmYAML::SymbolInfo &Info);
542 };
543 
544 template <> struct MappingTraits<WasmYAML::InitFunction> {
545  static void mapping(IO &IO, WasmYAML::InitFunction &Init);
546 };
547 
548 template <> struct ScalarEnumerationTraits<WasmYAML::ComdatKind> {
549  static void enumeration(IO &IO, WasmYAML::ComdatKind &Kind);
550 };
551 
552 template <> struct MappingTraits<WasmYAML::ComdatEntry> {
553  static void mapping(IO &IO, WasmYAML::ComdatEntry &ComdatEntry);
554 };
555 
556 template <> struct MappingTraits<WasmYAML::Comdat> {
557  static void mapping(IO &IO, WasmYAML::Comdat &Comdat);
558 };
559 
560 template <> struct ScalarEnumerationTraits<WasmYAML::ValueType> {
561  static void enumeration(IO &IO, WasmYAML::ValueType &Type);
562 };
563 
564 template <> struct ScalarEnumerationTraits<WasmYAML::ExportKind> {
565  static void enumeration(IO &IO, WasmYAML::ExportKind &Kind);
566 };
567 
568 template <> struct ScalarEnumerationTraits<WasmYAML::TableType> {
569  static void enumeration(IO &IO, WasmYAML::TableType &Type);
570 };
571 
572 template <> struct ScalarEnumerationTraits<WasmYAML::Opcode> {
573  static void enumeration(IO &IO, WasmYAML::Opcode &Opcode);
574 };
575 
576 template <> struct ScalarEnumerationTraits<WasmYAML::RelocType> {
577  static void enumeration(IO &IO, WasmYAML::RelocType &Kind);
578 };
579 
580 template <> struct MappingTraits<WasmYAML::Tag> {
581  static void mapping(IO &IO, WasmYAML::Tag &Tag);
582 };
583 
584 template <> struct MappingTraits<WasmYAML::DylinkExport> {
585  static void mapping(IO &IO, WasmYAML::DylinkExport &Export);
586 };
587 
588 } // end namespace yaml
589 } // end namespace llvm
590 
591 #endif // LLVM_OBJECTYAML_WASMYAML_H
llvm::wasm::WASM_SEC_EXPORT
@ WASM_SEC_EXPORT
Definition: Wasm.h:241
llvm::WasmYAML::LinkingSection::SymbolTable
std::vector< SymbolInfo > SymbolTable
Definition: WasmYAML.h:245
llvm::WasmYAML::TableSection::Tables
std::vector< Table > Tables
Definition: WasmYAML.h:312
llvm::WasmYAML::GlobalSection
Definition: WasmYAML.h:335
llvm::WasmYAML::FileHeader
Definition: WasmYAML.h:43
llvm::WasmYAML::Function::Locals
std::vector< LocalDecl > Locals
Definition: WasmYAML.h:106
llvm::WasmYAML::ProducerEntry::Name
std::string Name
Definition: WasmYAML.h:133
llvm::WasmYAML::DylinkExport::Flags
SymbolFlags Flags
Definition: WasmYAML.h:204
llvm::WasmYAML::FeatureEntry::Name
std::string Name
Definition: WasmYAML.h:139
llvm::WasmYAML::Section::Relocations
std::vector< Relocation > Relocations
Definition: WasmYAML.h:187
llvm::WasmYAML::InitFunction
Definition: WasmYAML.h:167
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::WasmYAML::Object::Sections
std::vector< std::unique_ptr< Section > > Sections
Definition: WasmYAML.h:407
llvm::wasm::WASM_TYPE_FUNC
@ WASM_TYPE_FUNC
Definition: Wasm.h:259
llvm::WasmYAML::Section::~Section
virtual ~Section()
llvm::WasmYAML::ProducersSection
Definition: WasmYAML.h:251
llvm::WasmYAML::ProducersSection::Tools
std::vector< ProducerEntry > Tools
Definition: WasmYAML.h:260
llvm::WasmYAML::StartSection::StartFunction
uint32_t StartFunction
Definition: WasmYAML.h:362
llvm::WasmYAML::InitFunction::Priority
uint32_t Priority
Definition: WasmYAML.h:168
llvm::WasmYAML::SymbolInfo::Index
uint32_t Index
Definition: WasmYAML.h:157
llvm::WasmYAML::NameEntry::Index
uint32_t Index
Definition: WasmYAML.h:128
llvm::WasmYAML::Import::TagImport
Tag TagImport
Definition: WasmYAML.h:95
llvm::wasm::WASM_SEC_START
@ WASM_SEC_START
Definition: Wasm.h:242
llvm::WasmYAML::FileHeader::Version
yaml::Hex32 Version
Definition: WasmYAML.h:44
llvm::WasmYAML::LocalDecl
Definition: WasmYAML.h:99
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:164
llvm::WasmYAML::NameSection::NameSection
NameSection()
Definition: WasmYAML.h:224
llvm::Function
Definition: Function.h:61
StringRef.h
llvm::WasmYAML::Import::SigIndex
uint32_t SigIndex
Definition: WasmYAML.h:91
llvm::WasmYAML::Comdat
Definition: WasmYAML.h:177
llvm::codeview::SymbolKind
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
llvm::WasmYAML::InitFunction::Symbol
uint32_t Symbol
Definition: WasmYAML.h:169
llvm::WasmYAML::FunctionSection::FunctionTypes
std::vector< uint32_t > FunctionTypes
Definition: WasmYAML.h:302
llvm::WasmYAML::TableSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:308
llvm::wasm::WASM_SEC_CODE
@ WASM_SEC_CODE
Definition: Wasm.h:244
llvm::WasmYAML::LinkingSection::LinkingSection
LinkingSection()
Definition: WasmYAML.h:237
LLVM_YAML_IS_SEQUENCE_VECTOR
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
llvm::WasmYAML::DataSection
Definition: WasmYAML.h:385
llvm::WasmYAML::DataSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:123
llvm::WasmYAML::DataSection::DataSection
DataSection()
Definition: WasmYAML.h:386
llvm::WasmYAML::ElemSection::ElemSection
ElemSection()
Definition: WasmYAML.h:366
llvm::WasmYAML::TagSection::Tags
std::vector< Tag > Tags
Definition: WasmYAML.h:332
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::WasmYAML::TableSection
Definition: WasmYAML.h:305
llvm::WasmYAML::ElemSection
Definition: WasmYAML.h:365
llvm::WasmYAML::SegmentInfo::Name
StringRef Name
Definition: WasmYAML.h:144
llvm::WasmYAML::ElemSegment
Definition: WasmYAML.h:65
llvm::WasmYAML::Relocation::Offset
yaml::Hex32 Offset
Definition: WasmYAML.h:115
llvm::WasmYAML::MemorySection
Definition: WasmYAML.h:315
llvm::wasm::WASM_SEC_GLOBAL
@ WASM_SEC_GLOBAL
Definition: Wasm.h:240
llvm::WasmYAML::NameSection::GlobalNames
std::vector< NameEntry > GlobalNames
Definition: WasmYAML.h:232
llvm::WasmYAML::DataSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:388
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:52
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:104
llvm::WasmYAML::ImportSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:288
llvm::WasmYAML::Tag::SigIndex
uint32_t SigIndex
Definition: WasmYAML.h:83
llvm::WasmYAML::GlobalSection::Globals
std::vector< Global > Globals
Definition: WasmYAML.h:342
llvm::WasmYAML::ProducerEntry
Definition: WasmYAML.h:132
llvm::WasmYAML::CustomSection::Name
StringRef Name
Definition: WasmYAML.h:198
llvm::wasm::WasmDataReference
Definition: Wasm.h:177
llvm::MachO::SymbolFlags
SymbolFlags
Symbol flags.
Definition: Symbol.h:25
llvm::wasm::WASM_SEC_MEMORY
@ WASM_SEC_MEMORY
Definition: Wasm.h:239
llvm::WasmYAML::LinkingSection::Comdats
std::vector< Comdat > Comdats
Definition: WasmYAML.h:248
llvm::WasmYAML::Import
Definition: WasmYAML.h:86
llvm::WasmYAML::Import::TableImport
Table TableImport
Definition: WasmYAML.h:93
llvm::WasmYAML::CustomSection
Definition: WasmYAML.h:190
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::WasmYAML::ProducerEntry::Version
std::string Version
Definition: WasmYAML.h:134
llvm::WasmYAML::ComdatEntry::Index
uint32_t Index
Definition: WasmYAML.h:174
llvm::WasmYAML::SegmentInfo::Index
uint32_t Index
Definition: WasmYAML.h:143
llvm::WasmYAML::Comdat::Name
StringRef Name
Definition: WasmYAML.h:178
llvm::WasmYAML::NameSection
Definition: WasmYAML.h:223
llvm::WasmYAML::DataSegment::Content
yaml::BinaryRef Content
Definition: WasmYAML.h:124
llvm::WasmYAML::GlobalSection::GlobalSection
GlobalSection()
Definition: WasmYAML.h:336
llvm::WasmYAML::Section
Definition: WasmYAML.h:182
llvm::WasmYAML::Relocation::Type
RelocType Type
Definition: WasmYAML.h:111
llvm::WasmYAML::Global::Index
uint32_t Index
Definition: WasmYAML.h:74
llvm::WasmYAML::Export::Kind
ExportKind Kind
Definition: WasmYAML.h:61
llvm::wasm::WASM_SEC_TYPE
@ WASM_SEC_TYPE
Definition: Wasm.h:235
llvm::WasmYAML::FunctionSection
Definition: WasmYAML.h:295
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::WasmYAML::LinkingSection::Version
uint32_t Version
Definition: WasmYAML.h:244
llvm::wasm::WASM_SEC_DATACOUNT
@ WASM_SEC_DATACOUNT
Definition: Wasm.h:246
llvm::WasmYAML::ProducersSection::ProducersSection
ProducersSection()
Definition: WasmYAML.h:252
llvm::WasmYAML::CodeSection::CodeSection
CodeSection()
Definition: WasmYAML.h:376
llvm::WasmYAML::Limits::Maximum
yaml::Hex32 Maximum
Definition: WasmYAML.h:50
llvm::wasm::WASM_SEC_ELEM
@ WASM_SEC_ELEM
Definition: Wasm.h:243
llvm::WasmYAML::ComdatEntry
Definition: WasmYAML.h:172
llvm::WasmYAML::Signature::ReturnTypes
std::vector< ValueType > ReturnTypes
Definition: WasmYAML.h:153
llvm::WasmYAML::CodeSection
Definition: WasmYAML.h:375
YAML.h
llvm::WasmYAML::SymbolInfo::Flags
SymbolFlags Flags
Definition: WasmYAML.h:160
llvm::WasmYAML::NameEntry
Definition: WasmYAML.h:127
llvm::WasmYAML::Table::TableLimits
Limits TableLimits
Definition: WasmYAML.h:55
llvm::WasmYAML::SegmentInfo::Flags
SegmentFlags Flags
Definition: WasmYAML.h:146
llvm::WasmYAML::LinkingSection::SegmentInfos
std::vector< SegmentInfo > SegmentInfos
Definition: WasmYAML.h:246
llvm::WasmYAML::Export::Name
StringRef Name
Definition: WasmYAML.h:60
llvm::WasmYAML::SymbolInfo
Definition: WasmYAML.h:156
llvm::WasmYAML::Function
Definition: WasmYAML.h:104
llvm::WasmYAML::ImportSection::ImportSection
ImportSection()
Definition: WasmYAML.h:286
llvm::WasmYAML::TargetFeaturesSection::Features
std::vector< FeatureEntry > Features
Definition: WasmYAML.h:272
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::WasmYAML::Limits
Definition: WasmYAML.h:47
llvm::wasm::WASM_SEC_DATA
@ WASM_SEC_DATA
Definition: Wasm.h:245
llvm::WasmYAML::Import::Module
StringRef Module
Definition: WasmYAML.h:87
llvm::WasmYAML::Import::GlobalImport
Global GlobalImport
Definition: WasmYAML.h:92
llvm::Comdat
Definition: Comdat.h:31
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::PassSummaryAction::Import
@ Import
Import information from summary.
llvm::WasmYAML::ExportSection
Definition: WasmYAML.h:345
llvm::WasmYAML::Signature::Index
uint32_t Index
Definition: WasmYAML.h:150
llvm::WasmYAML::ElemSegment::Functions
std::vector< uint32_t > Functions
Definition: WasmYAML.h:70
llvm::WasmYAML::Object::Header
FileHeader Header
Definition: WasmYAML.h:406
llvm::WasmYAML::Function::Index
uint32_t Index
Definition: WasmYAML.h:105
llvm::WasmYAML::Section::Type
SectionType Type
Definition: WasmYAML.h:186
llvm::WasmYAML::ElemSegment::Flags
uint32_t Flags
Definition: WasmYAML.h:66
llvm::WasmYAML::SegmentInfo
Definition: WasmYAML.h:142
llvm::WasmYAML::CustomSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:194
llvm::OutputFileType::Object
@ Object
llvm::WasmYAML::ExportSection::Exports
std::vector< Export > Exports
Definition: WasmYAML.h:352
llvm::WasmYAML::SymbolInfo::Kind
SymbolKind Kind
Definition: WasmYAML.h:159
llvm::WasmYAML::Relocation::Index
uint32_t Index
Definition: WasmYAML.h:112
llvm::WasmYAML::MemorySection::MemorySection
MemorySection()
Definition: WasmYAML.h:316
llvm::WasmYAML::CustomSection::CustomSection
CustomSection(StringRef Name)
Definition: WasmYAML.h:191
llvm::WasmYAML::TargetFeaturesSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:267
llvm::WasmYAML::DylinkExport
Definition: WasmYAML.h:202
llvm::WasmYAML::Global::Type
ValueType Type
Definition: WasmYAML.h:75
llvm::WasmYAML::CustomSection::Payload
yaml::BinaryRef Payload
Definition: WasmYAML.h:199
llvm::WasmYAML::FunctionSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:298
llvm::WasmYAML::TagSection::TagSection
TagSection()
Definition: WasmYAML.h:326
llvm::wasm::WASM_SEC_IMPORT
@ WASM_SEC_IMPORT
Definition: Wasm.h:236
llvm::WasmYAML::Signature::Form
SignatureForm Form
Definition: WasmYAML.h:151
llvm::WasmYAML::Table::Index
uint32_t Index
Definition: WasmYAML.h:56
llvm::WasmYAML::ElemSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:368
llvm::WasmYAML::Table
Definition: WasmYAML.h:53
LLVM_YAML_STRONG_TYPEDEF
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
llvm::WasmYAML::StartSection
Definition: WasmYAML.h:355
llvm::WasmYAML::TypeSection::Signatures
std::vector< Signature > Signatures
Definition: WasmYAML.h:282
llvm::WasmYAML::TargetFeaturesSection
Definition: WasmYAML.h:264
llvm::WasmYAML::ElemSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:69
llvm::WasmYAML::GlobalSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:338
llvm::WasmYAML::SymbolInfo::Name
StringRef Name
Definition: WasmYAML.h:158
llvm::WasmYAML::TagSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:328
llvm::AMDGPU::HSAMD::ValueType
ValueType
Value types.
Definition: AMDGPUMetadata.h:95
llvm::WasmYAML::FeatureEntry
Definition: WasmYAML.h:137
llvm::WasmYAML::Table::ElemType
TableType ElemType
Definition: WasmYAML.h:54
llvm::WasmYAML::StartSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:358
llvm::WasmYAML::FeatureEntry::Prefix
FeaturePolicyPrefix Prefix
Definition: WasmYAML.h:138
llvm::WasmYAML::Tag::Attribute
uint32_t Attribute
Definition: WasmYAML.h:82
llvm::WasmYAML::TypeSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:278
llvm::WasmYAML::ElemSegment::TableNumber
uint32_t TableNumber
Definition: WasmYAML.h:67
llvm::WasmYAML::DataCountSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:398
llvm::WasmYAML::CodeSection::Functions
std::vector< Function > Functions
Definition: WasmYAML.h:382
llvm::WasmYAML::Signature
Definition: WasmYAML.h:149
llvm::WasmYAML::Global::Mutable
bool Mutable
Definition: WasmYAML.h:76
llvm::WasmYAML::Import::Field
StringRef Field
Definition: WasmYAML.h:88
llvm::WasmYAML::ComdatEntry::Kind
ComdatKind Kind
Definition: WasmYAML.h:173
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::yaml::BinaryRef
Specialized YAMLIO scalar type for representing a binary blob.
Definition: YAML.h:63
llvm::WasmYAML::Relocation::Addend
int64_t Addend
Definition: WasmYAML.h:116
uint32_t
llvm::WasmYAML::Global::InitExpr
wasm::WasmInitExpr InitExpr
Definition: WasmYAML.h:77
llvm::WasmYAML::StartSection::StartSection
StartSection()
Definition: WasmYAML.h:356
llvm::WasmYAML::ProducersSection::SDKs
std::vector< ProducerEntry > SDKs
Definition: WasmYAML.h:261
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::WasmYAML::CodeSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:378
llvm::WasmYAML::LocalDecl::Count
uint32_t Count
Definition: WasmYAML.h:101
llvm::WasmYAML::Relocation
Definition: WasmYAML.h:110
llvm::WasmYAML::LinkingSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:239
llvm::wasm::WASM_SEC_FUNCTION
@ WASM_SEC_FUNCTION
Definition: Wasm.h:237
llvm::Init
Definition: Record.h:271
llvm::WasmYAML::Object
Definition: WasmYAML.h:405
llvm::PointerUnion< const Value *, const PseudoSourceValue * >
llvm::WasmYAML::Comdat::Entries
std::vector< ComdatEntry > Entries
Definition: WasmYAML.h:179
llvm::WasmYAML::ExportSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:348
llvm::WasmYAML::DataCountSection
Definition: WasmYAML.h:395
llvm::WasmYAML::DataSegment::InitFlags
uint32_t InitFlags
Definition: WasmYAML.h:121
llvm::WasmYAML::ExportSection::ExportSection
ExportSection()
Definition: WasmYAML.h:346
llvm::WasmYAML::TagSection
Definition: WasmYAML.h:325
llvm::WasmYAML::TypeSection::TypeSection
TypeSection()
Definition: WasmYAML.h:276
std
Definition: BitVector.h:838
llvm::WasmYAML::Import::Memory
Limits Memory
Definition: WasmYAML.h:94
llvm::WasmYAML::DataSegment
Definition: WasmYAML.h:119
llvm::WasmYAML::ProducersSection::Languages
std::vector< ProducerEntry > Languages
Definition: WasmYAML.h:259
llvm::WasmYAML::Section::Section
Section(SectionType SecType)
Definition: WasmYAML.h:183
llvm::WasmYAML::DataSegment::MemoryIndex
uint32_t MemoryIndex
Definition: WasmYAML.h:122
llvm::WasmYAML::Limits::Flags
LimitFlags Flags
Definition: WasmYAML.h:48
llvm::WasmYAML::SegmentInfo::Alignment
uint32_t Alignment
Definition: WasmYAML.h:145
llvm::WasmYAML::DataCountSection::Count
uint32_t Count
Definition: WasmYAML.h:402
llvm::WasmYAML::DataSection::Segments
std::vector< DataSegment > Segments
Definition: WasmYAML.h:392
llvm::wasm::WASM_SEC_TAG
@ WASM_SEC_TAG
Definition: Wasm.h:247
Casting.h
llvm::WasmYAML::LinkingSection
Definition: WasmYAML.h:236
llvm::sampleprof::SecType
SecType
Definition: SampleProf.h:121
llvm::WasmYAML::Global
Definition: WasmYAML.h:73
llvm::WasmYAML::Tag::Index
uint32_t Index
Definition: WasmYAML.h:81
llvm::WasmYAML::MemorySection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:318
llvm::WasmYAML::TableSection::TableSection
TableSection()
Definition: WasmYAML.h:306
llvm::wasm::WasmInitExpr
Definition: Wasm.h:87
Wasm.h
llvm::WasmYAML::LinkingSection::InitFunctions
std::vector< InitFunction > InitFunctions
Definition: WasmYAML.h:247
llvm::WasmYAML::NameEntry::Name
StringRef Name
Definition: WasmYAML.h:129
llvm::WasmYAML::DylinkExport::Name
StringRef Name
Definition: WasmYAML.h:203
llvm::WasmYAML::Limits::Minimum
yaml::Hex32 Minimum
Definition: WasmYAML.h:49
llvm::WasmYAML::NameSection::FunctionNames
std::vector< NameEntry > FunctionNames
Definition: WasmYAML.h:231
llvm::WasmYAML::SymbolInfo::DataRef
wasm::WasmDataReference DataRef
Definition: WasmYAML.h:163
llvm::WasmYAML::Export
Definition: WasmYAML.h:59
llvm::WasmYAML::TypeSection
Definition: WasmYAML.h:275
llvm::WasmYAML::NameSection::DataSegmentNames
std::vector< NameEntry > DataSegmentNames
Definition: WasmYAML.h:233
llvm::WasmYAML::TargetFeaturesSection::TargetFeaturesSection
TargetFeaturesSection()
Definition: WasmYAML.h:265
llvm::WasmYAML::Signature::ParamTypes
std::vector< ValueType > ParamTypes
Definition: WasmYAML.h:152
llvm::WasmYAML::MemorySection::Memories
std::vector< Limits > Memories
Definition: WasmYAML.h:322
llvm::wasm::WASM_SEC_TABLE
@ WASM_SEC_TABLE
Definition: Wasm.h:238
llvm::WasmYAML::Import::Kind
ExportKind Kind
Definition: WasmYAML.h:89
llvm::WasmYAML::ElemSegment::ElemKind
ValueType ElemKind
Definition: WasmYAML.h:68
llvm::WasmYAML::Function::Body
yaml::BinaryRef Body
Definition: WasmYAML.h:107
llvm::WasmYAML::NameSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:226
llvm::WasmYAML::LocalDecl::Type
ValueType Type
Definition: WasmYAML.h:100
llvm::WasmYAML::DataSegment::SectionOffset
uint32_t SectionOffset
Definition: WasmYAML.h:120
llvm::WasmYAML::Export::Index
uint32_t Index
Definition: WasmYAML.h:62
llvm::WasmYAML::ImportSection
Definition: WasmYAML.h:285
llvm::WasmYAML::ProducersSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:254
llvm::WasmYAML::Tag
Definition: WasmYAML.h:80
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::WasmYAML::ElemSection::Segments
std::vector< ElemSegment > Segments
Definition: WasmYAML.h:372
llvm::WasmYAML::ImportSection::Imports
std::vector< Import > Imports
Definition: WasmYAML.h:292
llvm::MachO::SectionType
SectionType
These are the section type and attributes fields.
Definition: MachO.h:120
llvm::WasmYAML::DataCountSection::DataCountSection
DataCountSection()
Definition: WasmYAML.h:396
llvm::WasmYAML::SymbolInfo::ElementIndex
uint32_t ElementIndex
Definition: WasmYAML.h:162
llvm::wasm::WASM_SEC_CUSTOM
@ WASM_SEC_CUSTOM
Definition: Wasm.h:234
llvm::WasmYAML::FunctionSection::FunctionSection
FunctionSection()
Definition: WasmYAML.h:296