LLVM  13.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 Initial;
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 {
68  std::vector<uint32_t> Functions;
69 };
70 
71 struct Global {
74  bool Mutable;
76 };
77 
78 struct Event {
82 };
83 
84 struct Import {
87  ExportKind Kind;
88  union {
94  };
95 };
96 
97 struct LocalDecl {
100 };
101 
102 struct Function {
104  std::vector<LocalDecl> Locals;
106 };
107 
108 struct Relocation {
109  RelocType Type;
111  // TODO(wvo): this would strictly be better as Hex64, but that will change
112  // all existing obj2yaml output.
113  yaml::Hex32 Offset;
114  int64_t Addend;
115 };
116 
117 struct DataSegment {
123 };
124 
125 struct NameEntry {
128 };
129 
131  std::string Name;
132  std::string Version;
133 };
134 
135 struct FeatureEntry {
136  FeaturePolicyPrefix Prefix;
137  std::string Name;
138 };
139 
140 struct SegmentInfo {
144  SegmentFlags Flags;
145 };
146 
147 struct Signature {
149  SignatureForm Form = wasm::WASM_TYPE_FUNC;
150  std::vector<ValueType> ParamTypes;
151  std::vector<ValueType> ReturnTypes;
152 };
153 
154 struct SymbolInfo {
159  union {
162  };
163 };
164 
165 struct InitFunction {
168 };
169 
170 struct ComdatEntry {
171  ComdatKind Kind;
173 };
174 
175 struct Comdat {
177  std::vector<ComdatEntry> Entries;
178 };
179 
180 struct Section {
182  virtual ~Section();
183 
185  std::vector<Relocation> Relocations;
186 };
187 
190  : Section(wasm::WASM_SEC_CUSTOM), Name(Name) {}
191 
192  static bool classof(const Section *S) {
193  return S->Type == wasm::WASM_SEC_CUSTOM;
194  }
195 
198 };
199 
201  DylinkSection() : CustomSection("dylink") {}
202 
203  static bool classof(const Section *S) {
204  auto C = dyn_cast<CustomSection>(S);
205  return C && C->Name == "dylink";
206  }
207 
212  std::vector<StringRef> Needed;
213 };
214 
216  NameSection() : CustomSection("name") {}
217 
218  static bool classof(const Section *S) {
219  auto C = dyn_cast<CustomSection>(S);
220  return C && C->Name == "name";
221  }
222 
223  std::vector<NameEntry> FunctionNames;
224  std::vector<NameEntry> GlobalNames;
225  std::vector<NameEntry> DataSegmentNames;
226 };
227 
229  LinkingSection() : CustomSection("linking") {}
230 
231  static bool classof(const Section *S) {
232  auto C = dyn_cast<CustomSection>(S);
233  return C && C->Name == "linking";
234  }
235 
237  std::vector<SymbolInfo> SymbolTable;
238  std::vector<SegmentInfo> SegmentInfos;
239  std::vector<InitFunction> InitFunctions;
240  std::vector<Comdat> Comdats;
241 };
242 
244  ProducersSection() : CustomSection("producers") {}
245 
246  static bool classof(const Section *S) {
247  auto C = dyn_cast<CustomSection>(S);
248  return C && C->Name == "producers";
249  }
250 
251  std::vector<ProducerEntry> Languages;
252  std::vector<ProducerEntry> Tools;
253  std::vector<ProducerEntry> SDKs;
254 };
255 
257  TargetFeaturesSection() : CustomSection("target_features") {}
258 
259  static bool classof(const Section *S) {
260  auto C = dyn_cast<CustomSection>(S);
261  return C && C->Name == "target_features";
262  }
263 
264  std::vector<FeatureEntry> Features;
265 };
266 
269 
270  static bool classof(const Section *S) {
271  return S->Type == wasm::WASM_SEC_TYPE;
272  }
273 
274  std::vector<Signature> Signatures;
275 };
276 
279 
280  static bool classof(const Section *S) {
281  return S->Type == wasm::WASM_SEC_IMPORT;
282  }
283 
284  std::vector<Import> Imports;
285 };
286 
289 
290  static bool classof(const Section *S) {
291  return S->Type == wasm::WASM_SEC_FUNCTION;
292  }
293 
294  std::vector<uint32_t> FunctionTypes;
295 };
296 
299 
300  static bool classof(const Section *S) {
301  return S->Type == wasm::WASM_SEC_TABLE;
302  }
303 
304  std::vector<Table> Tables;
305 };
306 
309 
310  static bool classof(const Section *S) {
311  return S->Type == wasm::WASM_SEC_MEMORY;
312  }
313 
314  std::vector<Limits> Memories;
315 };
316 
319 
320  static bool classof(const Section *S) {
321  return S->Type == wasm::WASM_SEC_EVENT;
322  }
323 
324  std::vector<Event> Events;
325 };
326 
329 
330  static bool classof(const Section *S) {
331  return S->Type == wasm::WASM_SEC_GLOBAL;
332  }
333 
334  std::vector<Global> Globals;
335 };
336 
339 
340  static bool classof(const Section *S) {
341  return S->Type == wasm::WASM_SEC_EXPORT;
342  }
343 
344  std::vector<Export> Exports;
345 };
346 
349 
350  static bool classof(const Section *S) {
351  return S->Type == wasm::WASM_SEC_START;
352  }
353 
355 };
356 
359 
360  static bool classof(const Section *S) {
361  return S->Type == wasm::WASM_SEC_ELEM;
362  }
363 
364  std::vector<ElemSegment> Segments;
365 };
366 
369 
370  static bool classof(const Section *S) {
371  return S->Type == wasm::WASM_SEC_CODE;
372  }
373 
374  std::vector<Function> Functions;
375 };
376 
379 
380  static bool classof(const Section *S) {
381  return S->Type == wasm::WASM_SEC_DATA;
382  }
383 
384  std::vector<DataSegment> Segments;
385 };
386 
389 
390  static bool classof(const Section *S) {
391  return S->Type == wasm::WASM_SEC_DATACOUNT;
392  }
393 
395 };
396 
397 struct Object {
399  std::vector<std::unique_ptr<Section>> Sections;
400 };
401 
402 } // end namespace WasmYAML
403 } // end namespace llvm
404 
405 LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<llvm::WasmYAML::Section>)
427 
428 namespace llvm {
429 namespace yaml {
430 
431 template <> struct MappingTraits<WasmYAML::FileHeader> {
432  static void mapping(IO &IO, WasmYAML::FileHeader &FileHdr);
433 };
434 
435 template <> struct MappingTraits<std::unique_ptr<WasmYAML::Section>> {
436  static void mapping(IO &IO, std::unique_ptr<WasmYAML::Section> &Section);
437 };
438 
439 template <> struct MappingTraits<WasmYAML::Object> {
440  static void mapping(IO &IO, WasmYAML::Object &Object);
441 };
442 
443 template <> struct MappingTraits<WasmYAML::Import> {
444  static void mapping(IO &IO, WasmYAML::Import &Import);
445 };
446 
447 template <> struct MappingTraits<WasmYAML::Export> {
448  static void mapping(IO &IO, WasmYAML::Export &Export);
449 };
450 
451 template <> struct MappingTraits<WasmYAML::Global> {
452  static void mapping(IO &IO, WasmYAML::Global &Global);
453 };
454 
455 template <> struct ScalarBitSetTraits<WasmYAML::LimitFlags> {
456  static void bitset(IO &IO, WasmYAML::LimitFlags &Value);
457 };
458 
459 template <> struct ScalarBitSetTraits<WasmYAML::SymbolFlags> {
460  static void bitset(IO &IO, WasmYAML::SymbolFlags &Value);
461 };
462 
463 template <> struct ScalarEnumerationTraits<WasmYAML::SymbolKind> {
464  static void enumeration(IO &IO, WasmYAML::SymbolKind &Kind);
465 };
466 
467 template <> struct ScalarBitSetTraits<WasmYAML::SegmentFlags> {
468  static void bitset(IO &IO, WasmYAML::SegmentFlags &Value);
469 };
470 
471 template <> struct ScalarEnumerationTraits<WasmYAML::SectionType> {
472  static void enumeration(IO &IO, WasmYAML::SectionType &Type);
473 };
474 
475 template <> struct MappingTraits<WasmYAML::Signature> {
476  static void mapping(IO &IO, WasmYAML::Signature &Signature);
477 };
478 
479 template <> struct MappingTraits<WasmYAML::Table> {
480  static void mapping(IO &IO, WasmYAML::Table &Table);
481 };
482 
483 template <> struct MappingTraits<WasmYAML::Limits> {
484  static void mapping(IO &IO, WasmYAML::Limits &Limits);
485 };
486 
487 template <> struct MappingTraits<WasmYAML::Function> {
488  static void mapping(IO &IO, WasmYAML::Function &Function);
489 };
490 
491 template <> struct MappingTraits<WasmYAML::Relocation> {
492  static void mapping(IO &IO, WasmYAML::Relocation &Relocation);
493 };
494 
495 template <> struct MappingTraits<WasmYAML::NameEntry> {
496  static void mapping(IO &IO, WasmYAML::NameEntry &NameEntry);
497 };
498 
499 template <> struct MappingTraits<WasmYAML::ProducerEntry> {
500  static void mapping(IO &IO, WasmYAML::ProducerEntry &ProducerEntry);
501 };
502 
503 template <> struct ScalarEnumerationTraits<WasmYAML::FeaturePolicyPrefix> {
504  static void enumeration(IO &IO, WasmYAML::FeaturePolicyPrefix &Prefix);
505 };
506 
507 template <> struct MappingTraits<WasmYAML::FeatureEntry> {
508  static void mapping(IO &IO, WasmYAML::FeatureEntry &FeatureEntry);
509 };
510 
511 template <> struct MappingTraits<WasmYAML::SegmentInfo> {
512  static void mapping(IO &IO, WasmYAML::SegmentInfo &SegmentInfo);
513 };
514 
515 template <> struct MappingTraits<WasmYAML::LocalDecl> {
516  static void mapping(IO &IO, WasmYAML::LocalDecl &LocalDecl);
517 };
518 
519 template <> struct MappingTraits<wasm::WasmInitExpr> {
520  static void mapping(IO &IO, wasm::WasmInitExpr &Expr);
521 };
522 
523 template <> struct MappingTraits<WasmYAML::DataSegment> {
524  static void mapping(IO &IO, WasmYAML::DataSegment &Segment);
525 };
526 
527 template <> struct MappingTraits<WasmYAML::ElemSegment> {
528  static void mapping(IO &IO, WasmYAML::ElemSegment &Segment);
529 };
530 
531 template <> struct MappingTraits<WasmYAML::SymbolInfo> {
532  static void mapping(IO &IO, WasmYAML::SymbolInfo &Info);
533 };
534 
535 template <> struct MappingTraits<WasmYAML::InitFunction> {
536  static void mapping(IO &IO, WasmYAML::InitFunction &Init);
537 };
538 
539 template <> struct ScalarEnumerationTraits<WasmYAML::ComdatKind> {
540  static void enumeration(IO &IO, WasmYAML::ComdatKind &Kind);
541 };
542 
543 template <> struct MappingTraits<WasmYAML::ComdatEntry> {
544  static void mapping(IO &IO, WasmYAML::ComdatEntry &ComdatEntry);
545 };
546 
547 template <> struct MappingTraits<WasmYAML::Comdat> {
548  static void mapping(IO &IO, WasmYAML::Comdat &Comdat);
549 };
550 
551 template <> struct ScalarEnumerationTraits<WasmYAML::ValueType> {
552  static void enumeration(IO &IO, WasmYAML::ValueType &Type);
553 };
554 
555 template <> struct ScalarEnumerationTraits<WasmYAML::ExportKind> {
556  static void enumeration(IO &IO, WasmYAML::ExportKind &Kind);
557 };
558 
559 template <> struct ScalarEnumerationTraits<WasmYAML::TableType> {
560  static void enumeration(IO &IO, WasmYAML::TableType &Type);
561 };
562 
563 template <> struct ScalarEnumerationTraits<WasmYAML::Opcode> {
564  static void enumeration(IO &IO, WasmYAML::Opcode &Opcode);
565 };
566 
567 template <> struct ScalarEnumerationTraits<WasmYAML::RelocType> {
568  static void enumeration(IO &IO, WasmYAML::RelocType &Kind);
569 };
570 
571 template <> struct MappingTraits<WasmYAML::Event> {
572  static void mapping(IO &IO, WasmYAML::Event &Event);
573 };
574 
575 } // end namespace yaml
576 } // end namespace llvm
577 
578 #endif // LLVM_OBJECTYAML_WASMYAML_H
llvm::EngineKind::Kind
Kind
Definition: ExecutionEngine.h:524
llvm::WasmYAML::LinkingSection::SymbolTable
std::vector< SymbolInfo > SymbolTable
Definition: WasmYAML.h:237
llvm::WasmYAML::TableSection::Tables
std::vector< Table > Tables
Definition: WasmYAML.h:304
llvm::WasmYAML::GlobalSection
Definition: WasmYAML.h:327
llvm::WasmYAML::FileHeader
Definition: WasmYAML.h:43
llvm::WasmYAML::Function::Locals
std::vector< LocalDecl > Locals
Definition: WasmYAML.h:104
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::Section::Relocations
std::vector< Relocation > Relocations
Definition: WasmYAML.h:185
llvm::WasmYAML::InitFunction
Definition: WasmYAML.h:165
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::WasmYAML::Object::Sections
std::vector< std::unique_ptr< Section > > Sections
Definition: WasmYAML.h:399
llvm::WasmYAML::Section::~Section
virtual ~Section()
llvm::WasmYAML::ProducersSection
Definition: WasmYAML.h:243
llvm::WasmYAML::ProducersSection::Tools
std::vector< ProducerEntry > Tools
Definition: WasmYAML.h:252
llvm::WasmYAML::StartSection::StartFunction
uint32_t StartFunction
Definition: WasmYAML.h:354
llvm::WasmYAML::InitFunction::Priority
uint32_t Priority
Definition: WasmYAML.h:166
llvm::WasmYAML::SymbolInfo::Index
uint32_t Index
Definition: WasmYAML.h:155
llvm::WasmYAML::NameEntry::Index
uint32_t Index
Definition: WasmYAML.h:126
llvm::WasmYAML::FileHeader::Version
yaml::Hex32 Version
Definition: WasmYAML.h:44
llvm::WasmYAML::LocalDecl
Definition: WasmYAML.h:97
llvm::wasm::WASM_TYPE_FUNC
@ WASM_TYPE_FUNC
Definition: Wasm.h:251
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:161
llvm::WasmYAML::NameSection::NameSection
NameSection()
Definition: WasmYAML.h:216
llvm::Function
Definition: Function.h:61
StringRef.h
llvm::WasmYAML::Import::SigIndex
uint32_t SigIndex
Definition: WasmYAML.h:89
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::wasm::WASM_SEC_GLOBAL
@ WASM_SEC_GLOBAL
Definition: Wasm.h:232
llvm::WasmYAML::EventSection::EventSection
EventSection()
Definition: WasmYAML.h:318
llvm::WasmYAML::InitFunction::Symbol
uint32_t Symbol
Definition: WasmYAML.h:167
llvm::WasmYAML::FunctionSection::FunctionTypes
std::vector< uint32_t > FunctionTypes
Definition: WasmYAML.h:294
llvm::wasm::WASM_SEC_START
@ WASM_SEC_START
Definition: Wasm.h:234
llvm::WasmYAML::TableSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:300
llvm::WasmYAML::LinkingSection::LinkingSection
LinkingSection()
Definition: WasmYAML.h:229
LLVM_YAML_IS_SEQUENCE_VECTOR
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
llvm::WasmYAML::DataSection
Definition: WasmYAML.h:377
llvm::WasmYAML::DataSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:121
llvm::WasmYAML::DataSection::DataSection
DataSection()
Definition: WasmYAML.h:378
llvm::WasmYAML::ElemSection::ElemSection
ElemSection()
Definition: WasmYAML.h:358
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::Import::EventImport
Event EventImport
Definition: WasmYAML.h:93
llvm::WasmYAML::SegmentInfo::Name
StringRef Name
Definition: WasmYAML.h:142
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::WasmYAML::NameSection::GlobalNames
std::vector< NameEntry > GlobalNames
Definition: WasmYAML.h:224
llvm::WasmYAML::DataSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:380
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:50
llvm::WasmYAML::ElemSegment::TableIndex
uint32_t TableIndex
Definition: WasmYAML.h:66
llvm::WasmYAML::ImportSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:280
llvm::WasmYAML::GlobalSection::Globals
std::vector< Global > Globals
Definition: WasmYAML.h:334
llvm::WasmYAML::ProducerEntry
Definition: WasmYAML.h:130
llvm::WasmYAML::CustomSection::Name
StringRef Name
Definition: WasmYAML.h:196
llvm::wasm::WasmDataReference
Definition: Wasm.h:169
llvm::MachO::SymbolFlags
SymbolFlags
Symbol flags.
Definition: Symbol.h:25
llvm::wasm::WASM_SEC_EXPORT
@ WASM_SEC_EXPORT
Definition: Wasm.h:233
llvm::WasmYAML::LinkingSection::Comdats
std::vector< Comdat > Comdats
Definition: WasmYAML.h:240
llvm::WasmYAML::Import
Definition: WasmYAML.h:84
llvm::WasmYAML::Import::TableImport
Table TableImport
Definition: WasmYAML.h:91
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::WasmYAML::Comdat::Name
StringRef Name
Definition: WasmYAML.h:176
llvm::WasmYAML::NameSection
Definition: WasmYAML.h:215
llvm::WasmYAML::DataSegment::Content
yaml::BinaryRef Content
Definition: WasmYAML.h:122
llvm::WasmYAML::GlobalSection::GlobalSection
GlobalSection()
Definition: WasmYAML.h:328
llvm::WasmYAML::Section
Definition: WasmYAML.h:180
llvm::WasmYAML::Relocation::Type
RelocType Type
Definition: WasmYAML.h:109
llvm::WasmYAML::Global::Index
uint32_t Index
Definition: WasmYAML.h:72
llvm::WasmYAML::Export::Kind
ExportKind Kind
Definition: WasmYAML.h:61
llvm::WasmYAML::FunctionSection
Definition: WasmYAML.h:287
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::WasmYAML::LinkingSection::Version
uint32_t Version
Definition: WasmYAML.h:236
llvm::WasmYAML::ProducersSection::ProducersSection
ProducersSection()
Definition: WasmYAML.h:244
llvm::WasmYAML::CodeSection::CodeSection
CodeSection()
Definition: WasmYAML.h:368
llvm::WasmYAML::Limits::Maximum
yaml::Hex32 Maximum
Definition: WasmYAML.h:50
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
YAML.h
llvm::WasmYAML::SymbolInfo::Flags
SymbolFlags Flags
Definition: WasmYAML.h:158
llvm::WasmYAML::NameEntry
Definition: WasmYAML.h:125
llvm::WasmYAML::Table::TableLimits
Limits TableLimits
Definition: WasmYAML.h:55
llvm::WasmYAML::SegmentInfo::Flags
SegmentFlags Flags
Definition: WasmYAML.h:144
llvm::WasmYAML::LinkingSection::SegmentInfos
std::vector< SegmentInfo > SegmentInfos
Definition: WasmYAML.h:238
llvm::WasmYAML::Export::Name
StringRef Name
Definition: WasmYAML.h:60
llvm::WasmYAML::SymbolInfo
Definition: WasmYAML.h:154
llvm::WasmYAML::Function
Definition: WasmYAML.h:102
llvm::WasmYAML::ImportSection::ImportSection
ImportSection()
Definition: WasmYAML.h:278
llvm::WasmYAML::TargetFeaturesSection::Features
std::vector< FeatureEntry > Features
Definition: WasmYAML.h:264
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::Import::Module
StringRef Module
Definition: WasmYAML.h:85
llvm::WasmYAML::Import::GlobalImport
Global GlobalImport
Definition: WasmYAML.h:90
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::WasmYAML::Signature::Index
uint32_t Index
Definition: WasmYAML.h:148
llvm::WasmYAML::ElemSegment::Functions
std::vector< uint32_t > Functions
Definition: WasmYAML.h:68
llvm::WasmYAML::Object::Header
FileHeader Header
Definition: WasmYAML.h:398
llvm::WasmYAML::Function::Index
uint32_t Index
Definition: WasmYAML.h:103
llvm::WasmYAML::Section::Type
SectionType Type
Definition: WasmYAML.h:184
llvm::WasmYAML::SegmentInfo
Definition: WasmYAML.h:140
llvm::WasmYAML::CustomSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:192
llvm::OutputFileType::Object
@ Object
llvm::WasmYAML::ExportSection::Exports
std::vector< Export > Exports
Definition: WasmYAML.h:344
llvm::WasmYAML::SymbolInfo::Kind
SymbolKind Kind
Definition: WasmYAML.h:157
llvm::WasmYAML::Relocation::Index
uint32_t Index
Definition: WasmYAML.h:110
llvm::WasmYAML::MemorySection::MemorySection
MemorySection()
Definition: WasmYAML.h:308
llvm::WasmYAML::CustomSection::CustomSection
CustomSection(StringRef Name)
Definition: WasmYAML.h:189
llvm::WasmYAML::TargetFeaturesSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:259
llvm::WasmYAML::Global::Type
ValueType Type
Definition: WasmYAML.h:73
llvm::WasmYAML::CustomSection::Payload
yaml::BinaryRef Payload
Definition: WasmYAML.h:197
llvm::WasmYAML::FunctionSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:290
llvm::WasmYAML::Signature::Form
SignatureForm Form
Definition: WasmYAML.h:149
llvm::WasmYAML::Table::Index
uint32_t Index
Definition: WasmYAML.h:56
llvm::WasmYAML::ElemSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:360
llvm::WasmYAML::Table
Definition: WasmYAML.h:53
LLVM_YAML_STRONG_TYPEDEF
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
llvm::WasmYAML::StartSection
Definition: WasmYAML.h:347
llvm::WasmYAML::TypeSection::Signatures
std::vector< Signature > Signatures
Definition: WasmYAML.h:274
llvm::wasm::WASM_SEC_EVENT
@ WASM_SEC_EVENT
Definition: Wasm.h:239
llvm::WasmYAML::TargetFeaturesSection
Definition: WasmYAML.h:256
llvm::WasmYAML::ElemSegment::Offset
wasm::WasmInitExpr Offset
Definition: WasmYAML.h:67
llvm::WasmYAML::GlobalSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:330
llvm::WasmYAML::SymbolInfo::Name
StringRef Name
Definition: WasmYAML.h:156
llvm::WasmYAML::EventSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:320
llvm::AMDGPU::HSAMD::ValueType
ValueType
Value types.
Definition: AMDGPUMetadata.h:85
llvm::WasmYAML::FeatureEntry
Definition: WasmYAML.h:135
llvm::WasmYAML::Table::ElemType
TableType ElemType
Definition: WasmYAML.h:54
llvm::WasmYAML::StartSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:350
llvm::WasmYAML::FeatureEntry::Prefix
FeaturePolicyPrefix Prefix
Definition: WasmYAML.h:136
llvm::wasm::WASM_SEC_TYPE
@ WASM_SEC_TYPE
Definition: Wasm.h:227
llvm::WasmYAML::TypeSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:270
llvm::WasmYAML::DataCountSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:390
llvm::WasmYAML::CodeSection::Functions
std::vector< Function > Functions
Definition: WasmYAML.h:374
llvm::WasmYAML::Signature
Definition: WasmYAML.h:147
llvm::WasmYAML::Global::Mutable
bool Mutable
Definition: WasmYAML.h:74
llvm::WasmYAML::Import::Field
StringRef Field
Definition: WasmYAML.h:86
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::yaml::BinaryRef
Specialized YAMLIO scalar type for representing a binary blob.
Definition: YAML.h:63
llvm::WasmYAML::Event::SigIndex
uint32_t SigIndex
Definition: WasmYAML.h:81
llvm::WasmYAML::Relocation::Addend
int64_t Addend
Definition: WasmYAML.h:114
uint32_t
llvm::WasmYAML::Global::InitExpr
wasm::WasmInitExpr InitExpr
Definition: WasmYAML.h:75
llvm::WasmYAML::StartSection::StartSection
StartSection()
Definition: WasmYAML.h:348
llvm::WasmYAML::ProducersSection::SDKs
std::vector< ProducerEntry > SDKs
Definition: WasmYAML.h:253
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:370
llvm::WasmYAML::LocalDecl::Count
uint32_t Count
Definition: WasmYAML.h:99
llvm::WasmYAML::Relocation
Definition: WasmYAML.h:108
llvm::WasmYAML::LinkingSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:231
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::WasmYAML::EventSection::Events
std::vector< Event > Events
Definition: WasmYAML.h:324
llvm::PointerUnion< const Value *, const PseudoSourceValue * >
llvm::wasm::WASM_SEC_FUNCTION
@ WASM_SEC_FUNCTION
Definition: Wasm.h:229
llvm::WasmYAML::Comdat::Entries
std::vector< ComdatEntry > Entries
Definition: WasmYAML.h:177
llvm::WasmYAML::ExportSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:340
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::WasmYAML::ExportSection::ExportSection
ExportSection()
Definition: WasmYAML.h:338
llvm::WasmYAML::TypeSection::TypeSection
TypeSection()
Definition: WasmYAML.h:268
std
Definition: BitVector.h:941
llvm::WasmYAML::Import::Memory
Limits Memory
Definition: WasmYAML.h:92
llvm::WasmYAML::DataSegment
Definition: WasmYAML.h:117
llvm::WasmYAML::ProducersSection::Languages
std::vector< ProducerEntry > Languages
Definition: WasmYAML.h:251
llvm::WasmYAML::Section::Section
Section(SectionType SecType)
Definition: WasmYAML.h:181
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::WasmYAML::DataCountSection::Count
uint32_t Count
Definition: WasmYAML.h:394
llvm::WasmYAML::DataSection::Segments
std::vector< DataSegment > Segments
Definition: WasmYAML.h:384
llvm::wasm::WASM_SEC_CUSTOM
@ WASM_SEC_CUSTOM
Definition: Wasm.h:226
Casting.h
llvm::WasmYAML::LinkingSection
Definition: WasmYAML.h:228
llvm::sampleprof::SecType
SecType
Definition: SampleProf.h:118
llvm::WasmYAML::Global
Definition: WasmYAML.h:71
llvm::WasmYAML::MemorySection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:310
llvm::WasmYAML::TableSection::TableSection
TableSection()
Definition: WasmYAML.h:298
llvm::wasm::WasmInitExpr
Definition: Wasm.h:81
Wasm.h
llvm::WasmYAML::LinkingSection::InitFunctions
std::vector< InitFunction > InitFunctions
Definition: WasmYAML.h:239
llvm::WasmYAML::NameEntry::Name
StringRef Name
Definition: WasmYAML.h:127
llvm::WasmYAML::NameSection::FunctionNames
std::vector< NameEntry > FunctionNames
Definition: WasmYAML.h:223
llvm::WasmYAML::SymbolInfo::DataRef
wasm::WasmDataReference DataRef
Definition: WasmYAML.h:161
llvm::WasmYAML::Export
Definition: WasmYAML.h:59
llvm::WasmYAML::TypeSection
Definition: WasmYAML.h:267
llvm::WasmYAML::NameSection::DataSegmentNames
std::vector< NameEntry > DataSegmentNames
Definition: WasmYAML.h:225
llvm::WasmYAML::TargetFeaturesSection::TargetFeaturesSection
TargetFeaturesSection()
Definition: WasmYAML.h:257
llvm::WasmYAML::Signature::ParamTypes
std::vector< ValueType > ParamTypes
Definition: WasmYAML.h:150
llvm::WasmYAML::MemorySection::Memories
std::vector< Limits > Memories
Definition: WasmYAML.h:314
llvm::WasmYAML::Import::Kind
ExportKind Kind
Definition: WasmYAML.h:87
llvm::WasmYAML::Limits::Initial
yaml::Hex32 Initial
Definition: WasmYAML.h:49
llvm::WasmYAML::Function::Body
yaml::BinaryRef Body
Definition: WasmYAML.h:105
llvm::WasmYAML::NameSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:218
llvm::WasmYAML::LocalDecl::Type
ValueType Type
Definition: WasmYAML.h:98
llvm::WasmYAML::DataSegment::SectionOffset
uint32_t SectionOffset
Definition: WasmYAML.h:118
llvm::WasmYAML::Export::Index
uint32_t Index
Definition: WasmYAML.h:62
llvm::WasmYAML::ImportSection
Definition: WasmYAML.h:277
llvm::WasmYAML::ProducersSection::classof
static bool classof(const Section *S)
Definition: WasmYAML.h:246
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::WasmYAML::ElemSection::Segments
std::vector< ElemSegment > Segments
Definition: WasmYAML.h:364
llvm::WasmYAML::ImportSection::Imports
std::vector< Import > Imports
Definition: WasmYAML.h:284
llvm::MachO::SectionType
SectionType
These are the section type and attributes fields.
Definition: MachO.h:120
llvm::WasmYAML::DataCountSection::DataCountSection
DataCountSection()
Definition: WasmYAML.h:388
llvm::WasmYAML::SymbolInfo::ElementIndex
uint32_t ElementIndex
Definition: WasmYAML.h:160
llvm::WasmYAML::FunctionSection::FunctionSection
FunctionSection()
Definition: WasmYAML.h:288