LLVM: lib/ObjectYAML/WasmYAML.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

19

20namespace llvm {

21

23

24

25

27

28}

29

30namespace yaml {

31

36

45

48 IO.mapOptional("Relocations", Section.Relocations);

49 IO.mapOptional("HeaderSecSizeEncodingLen", Section.HeaderSecSizeEncodingLen);

50}

51

64

72

82

90

96

102

107

112

117

122

127

132

137

142

147

152

157

162

167

169 IO &IO, std::unique_ptrWasmYAML::Section &Section) {

170 WasmYAML::SectionType SectionType;

172 SectionType = Section->Type;

173 else

175

176 switch (SectionType) {

182 } else {

184 }

201 } else if (SectionName == "target_features") {

205 } else {

209 }

210 break;

211 }

216 break;

221 break;

226 break;

231 break;

236 break;

241 break;

246 break;

251 break;

256 break;

261 break;

266 break;

271 break;

276 break;

277 default:

279 }

280}

281

283 IO &IO, WasmYAML::SectionType &Type) {

284#define ECase(X) IO.enumCase(Type, #X, wasm::WASM_SEC_##X);

298 ECase(DATACOUNT);

299#undef ECase

300}

301

308

314

321

329

335

341

343 IO &IO, WasmYAML::FeaturePolicyPrefix &Kind) {

344#define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_FEATURE_PREFIX_##X);

346 ECase(DISALLOWED);

347#undef ECase

348}

349

355

363

369

379

394

414

421

429

435 } else {

442 break;

445 break;

448 break;

451 break;

454 break;

458 break;

459 }

460 }

461 }

462}

463

470 } else {

472 }

475 } else {

478 }

480}

481

487

489 IO &IO, WasmYAML::ComdatKind &Kind) {

490#define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_COMDAT_##X);

494#undef ECase

495}

496

502

508

528 }

531 }

534 } else {

536 }

537}

538

545

551

553 IO &IO, WasmYAML::LimitFlags &Value) {

554#define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_LIMITS_FLAG_##X)

556 BCase(IS_SHARED);

558 BCase(HAS_PAGE_SIZE);

559#undef BCase

560}

561

563 IO &IO, WasmYAML::SegmentFlags &Value) {

564#define BCase(X) IO.bitSetCase(Value, #X, wasm::WASM_SEG_FLAG_##X)

568#undef BCase

569}

570

572 IO &IO, WasmYAML::SymbolFlags &Value) {

573#define BCaseMask(M, X) \

574 IO.maskedBitSetCase(Value, #X, wasm::WASM_SYMBOL_##X, wasm::WASM_SYMBOL_##M)

575

576 BCaseMask(BINDING_MASK, BINDING_WEAK);

577 BCaseMask(BINDING_MASK, BINDING_LOCAL);

578

582 BCaseMask(EXPLICIT_NAME, EXPLICIT_NAME);

586#undef BCaseMask

587}

588

590 IO &IO, WasmYAML::SymbolKind &Kind) {

591#define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_SYMBOL_TYPE_##X);

598#undef ECase

599}

600

602 IO &IO, WasmYAML::ValueType &Type) {

603#define CONCAT(X) (uint32_t) wasm::ValType::X

604#define ECase(X) IO.enumCase(Type, #X, CONCAT(X));

611 ECase(EXTERNREF);

614#undef ECase

615}

616

618 IO &IO, WasmYAML::ExportKind &Kind) {

619#define ECase(X) IO.enumCase(Kind, #X, wasm::WASM_EXTERNAL_##X);

625#undef ECase

626}

627

629 IO &IO, WasmYAML::Opcode &Code) {

630#define ECase(X) IO.enumCase(Code, #X, wasm::WASM_OPCODE_##X);

632 ECase(I32_CONST);

633 ECase(I64_CONST);

634 ECase(F64_CONST);

635 ECase(F32_CONST);

636 ECase(GLOBAL_GET);

638#undef ECase

639}

640

642 IO &IO, WasmYAML::TableType &Type) {

643#define CONCAT(X) (uint32_t) wasm::ValType::X

644#define ECase(X) IO.enumCase(Type, #X, CONCAT(X));

646 ECase(EXTERNREF);

649#undef ECase

650}

651

653 IO &IO, WasmYAML::RelocType &Type) {

654#define WASM_RELOC(name, value) IO.enumCase(Type, #name, wasm::name);

655#include "llvm/BinaryFormat/WasmRelocs.def"

656#undef WASM_RELOC

658}

659

660}

661

662}

Analysis containing CSE Info

#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC)

static constexpr auto TAG

This file declares classes for handling the YAML representation of wasm binaries.

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

LLVM Value Representation.

virtual bool outputting() const =0

virtual bool mapTag(StringRef Tag, bool Default=false)=0

void mapOptional(StringRef Key, T &Val)

void enumFallback(T &Val)

void mapRequired(StringRef Key, T &Val)

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

constexpr uint16_t VISIBILITY_MASK

const unsigned WASM_SYMBOL_UNDEFINED

@ WASM_LIMITS_FLAG_HAS_MAX

@ WASM_LIMITS_FLAG_HAS_PAGE_SIZE

@ WASM_DATA_SEGMENT_IS_PASSIVE

@ WASM_DATA_SEGMENT_HAS_MEMINDEX

@ WASM_SYMBOL_TYPE_GLOBAL

@ WASM_SYMBOL_TYPE_SECTION

@ WASM_SYMBOL_TYPE_FUNCTION

@ WASM_ELEM_SEGMENT_HAS_TABLE_NUMBER

const unsigned WASM_SYMBOL_ABSOLUTE

const unsigned WASM_ELEM_SEGMENT_MASK_HAS_ELEM_DESC

static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section)

static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)

This is an optimization pass for GlobalISel generic memory operations.

@ Export

Export information to summary.

@ Import

Import information from summary.

@ Global

Append to llvm.global_dtors.

DWARFExpression::Operation Op

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

std::vector< uint32_t > Functions

FeaturePolicyPrefix Prefix

wasm::WasmInitExprMVP Inst

std::vector< ValueType > ReturnTypes

std::vector< ValueType > ParamTypes

union llvm::wasm::WasmInitExprMVP::@021046217255127373215144224227277301132130072341 Value

static void mapping(IO &IO, std::unique_ptr< WasmYAML::Section > &Section)

Definition WasmYAML.cpp:168

This class should be specialized by any type that needs to be converted to/from a YAML mapping.

This class should be specialized by any integer type that is a union of bit values and the YAML repre...

This class should be specialized by any integral type that converts to/from a YAML scalar where there...