Lines Matching defs:WasmObjectFile
1 //===- WasmObjectFile.cpp - Wasm object file implementation ---------------===//
65 Expected<std::unique_ptr<WasmObjectFile>>
68 auto ObjectFile = std::make_unique<WasmObjectFile>(Buffer, Err);
80 static uint8_t readUint8(WasmObjectFile::ReadContext &Ctx) {
86 static uint32_t readUint32(WasmObjectFile::ReadContext &Ctx) {
94 static int32_t readFloat32(WasmObjectFile::ReadContext &Ctx) {
103 static int64_t readFloat64(WasmObjectFile::ReadContext &Ctx) {
112 static uint64_t readULEB128(WasmObjectFile::ReadContext &Ctx) {
122 static StringRef readString(WasmObjectFile::ReadContext &Ctx) {
132 static int64_t readLEB128(WasmObjectFile::ReadContext &Ctx) {
142 static uint8_t readVaruint1(WasmObjectFile::ReadContext &Ctx) {
149 static int32_t readVarint32(WasmObjectFile::ReadContext &Ctx) {
156 static uint32_t readVaruint32(WasmObjectFile::ReadContext &Ctx) {
163 static int64_t readVarint64(WasmObjectFile::ReadContext &Ctx) {
167 static uint64_t readVaruint64(WasmObjectFile::ReadContext &Ctx) {
171 static uint8_t readOpcode(WasmObjectFile::ReadContext &Ctx) {
175 static wasm::ValType parseValType(WasmObjectFile::ReadContext &Ctx,
197 WasmObjectFile::ReadContext &Ctx) {
288 static wasm::WasmLimits readLimits(WasmObjectFile::ReadContext &Ctx) {
297 static wasm::WasmTableType readTableType(WasmObjectFile::ReadContext &Ctx) {
305 static Error readSection(WasmSection &Section, WasmObjectFile::ReadContext &Ctx,
322 WasmObjectFile::ReadContext SectionCtx;
345 WasmObjectFile::WasmObjectFile(MemoryBufferRef Buffer, Error &Err)
386 Error WasmObjectFile::parseSection(WasmSection &Sec) {
426 Error WasmObjectFile::parseDylinkSection(ReadContext &Ctx) {
445 Error WasmObjectFile::parseDylink0Section(ReadContext &Ctx) {
504 Error WasmObjectFile::parseNameSection(ReadContext &Ctx) {
614 Error WasmObjectFile::parseLinkingSection(ReadContext &Ctx) {
683 Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) {
894 Error WasmObjectFile::parseLinkingSectionComdat(ReadContext &Ctx) {
950 Error WasmObjectFile::parseProducersSection(ReadContext &Ctx) {
991 Error WasmObjectFile::parseTargetFeaturesSection(ReadContext &Ctx) {
1020 Error WasmObjectFile::parseRelocSection(StringRef Name, ReadContext &Ctx) {
1154 Error WasmObjectFile::parseCustomSection(WasmSection &Sec, ReadContext &Ctx) {
1180 Error WasmObjectFile::parseTypeSection(ReadContext &Ctx) {
1257 Error WasmObjectFile::parseImportSection(ReadContext &Ctx) {
1318 Error WasmObjectFile::parseFunctionSection(ReadContext &Ctx) {
1337 Error WasmObjectFile::parseTableSection(ReadContext &Ctx) {
1361 Error WasmObjectFile::parseMemorySection(ReadContext &Ctx) {
1376 Error WasmObjectFile::parseTagSection(ReadContext &Ctx) {
1402 Error WasmObjectFile::parseGlobalSection(ReadContext &Ctx) {
1426 Error WasmObjectFile::parseExportSection(ReadContext &Ctx) {
1508 bool WasmObjectFile::isValidFunctionIndex(uint32_t Index) const {
1512 bool WasmObjectFile::isDefinedFunctionIndex(uint32_t Index) const {
1516 bool WasmObjectFile::isValidGlobalIndex(uint32_t Index) const {
1520 bool WasmObjectFile::isValidTableNumber(uint32_t Index) const {
1524 bool WasmObjectFile::isDefinedGlobalIndex(uint32_t Index) const {
1528 bool WasmObjectFile::isDefinedTableNumber(uint32_t Index) const {
1532 bool WasmObjectFile::isValidTagIndex(uint32_t Index) const {
1536 bool WasmObjectFile::isDefinedTagIndex(uint32_t Index) const {
1540 bool WasmObjectFile::isValidFunctionSymbol(uint32_t Index) const {
1544 bool WasmObjectFile::isValidTableSymbol(uint32_t Index) const {
1548 bool WasmObjectFile::isValidGlobalSymbol(uint32_t Index) const {
1552 bool WasmObjectFile::isValidTagSymbol(uint32_t Index) const {
1556 bool WasmObjectFile::isValidDataSymbol(uint32_t Index) const {
1560 bool WasmObjectFile::isValidSectionSymbol(uint32_t Index) const {
1564 wasm::WasmFunction &WasmObjectFile::getDefinedFunction(uint32_t Index) {
1570 WasmObjectFile::getDefinedFunction(uint32_t Index) const {
1575 const wasm::WasmGlobal &WasmObjectFile::getDefinedGlobal(uint32_t Index) const {
1580 wasm::WasmTag &WasmObjectFile::getDefinedTag(uint32_t Index) {
1585 Error WasmObjectFile::parseStartSection(ReadContext &Ctx) {
1593 Error WasmObjectFile::parseCodeSection(ReadContext &Ctx) {
1639 Error WasmObjectFile::parseElemSection(ReadContext &Ctx) {
1736 Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
1778 Error WasmObjectFile::parseDataCountSection(ReadContext &Ctx) {
1783 const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {
1787 void WasmObjectFile::moveSymbolNext(DataRefImpl &Symb) const { Symb.d.b++; }
1789 Expected<uint32_t> WasmObjectFile::getSymbolFlags(DataRefImpl Symb) const {
1807 basic_symbol_iterator WasmObjectFile::symbol_begin() const {
1814 basic_symbol_iterator WasmObjectFile::symbol_end() const {
1821 const WasmSymbol &WasmObjectFile::getWasmSymbol(const DataRefImpl &Symb) const {
1825 const WasmSymbol &WasmObjectFile::getWasmSymbol(const SymbolRef &Symb) const {
1829 Expected<StringRef> WasmObjectFile::getSymbolName(DataRefImpl Symb) const {
1833 Expected<uint64_t> WasmObjectFile::getSymbolAddress(DataRefImpl Symb) const {
1854 uint64_t WasmObjectFile::getWasmSymbolValue(const WasmSymbol &Sym) const {
1884 uint64_t WasmObjectFile::getSymbolValueImpl(DataRefImpl Symb) const {
1888 uint32_t WasmObjectFile::getSymbolAlignment(DataRefImpl Symb) const {
1893 uint64_t WasmObjectFile::getCommonSymbolSizeImpl(DataRefImpl Symb) const {
1899 WasmObjectFile::getSymbolType(DataRefImpl Symb) const {
1922 WasmObjectFile::getSymbolSection(DataRefImpl Symb) const {
1932 uint32_t WasmObjectFile::getSymbolSectionId(SymbolRef Symb) const {
1937 uint32_t WasmObjectFile::getSymbolSectionIdImpl(const WasmSymbol &Sym) const {
1956 uint32_t WasmObjectFile::getSymbolSize(SymbolRef Symb) const {
1972 void WasmObjectFile::moveSectionNext(DataRefImpl &Sec) const { Sec.d.a++; }
1974 Expected<StringRef> WasmObjectFile::getSectionName(DataRefImpl Sec) const {
1983 uint64_t WasmObjectFile::getSectionAddress(DataRefImpl Sec) const {
1991 uint64_t WasmObjectFile::getSectionIndex(DataRefImpl Sec) const {
1995 uint64_t WasmObjectFile::getSectionSize(DataRefImpl Sec) const {
2001 WasmObjectFile::getSectionContents(DataRefImpl Sec) const {
2008 uint64_t WasmObjectFile::getSectionAlignment(DataRefImpl Sec) const {
2012 bool WasmObjectFile::isSectionCompressed(DataRefImpl Sec) const {
2016 bool WasmObjectFile::isSectionText(DataRefImpl Sec) const {
2020 bool WasmObjectFile::isSectionData(DataRefImpl Sec) const {
2024 bool WasmObjectFile::isSectionBSS(DataRefImpl Sec) const { return false; }
2026 bool WasmObjectFile::isSectionVirtual(DataRefImpl Sec) const { return false; }
2028 relocation_iterator WasmObjectFile::section_rel_begin(DataRefImpl Ref) const {
2035 relocation_iterator WasmObjectFile::section_rel_end(DataRefImpl Ref) const {
2043 void WasmObjectFile::moveRelocationNext(DataRefImpl &Rel) const { Rel.d.b++; }
2045 uint64_t WasmObjectFile::getRelocationOffset(DataRefImpl Ref) const {
2050 symbol_iterator WasmObjectFile::getRelocationSymbol(DataRefImpl Ref) const {
2060 uint64_t WasmObjectFile::getRelocationType(DataRefImpl Ref) const {
2065 void WasmObjectFile::getRelocationTypeName(
2084 section_iterator WasmObjectFile::section_begin() const {
2090 section_iterator WasmObjectFile::section_end() const {
2096 uint8_t WasmObjectFile::getBytesInAddress() const {
2100 StringRef WasmObjectFile::getFileFormatName() const { return "WASM"; }
2102 Triple::ArchType WasmObjectFile::getArch() const {
2106 Expected<SubtargetFeatures> WasmObjectFile::getFeatures() const {
2110 bool WasmObjectFile::isRelocatableObject() const { return HasLinkingSection; }
2112 bool WasmObjectFile::isSharedObject() const { return HasDylinkSection; }
2114 const WasmSection &WasmObjectFile::getWasmSection(DataRefImpl Ref) const {
2120 WasmObjectFile::getWasmSection(const SectionRef &Section) const {
2125 WasmObjectFile::getWasmRelocation(const RelocationRef &Ref) const {
2130 WasmObjectFile::getWasmRelocation(DataRefImpl Ref) const {