class WasmObjectFile

Declaration

class WasmObjectFile : public ObjectFile { /* full declaration omitted */ };

Description

This class is the base class for all object file types. Concrete instances of this object are created by createObjectFile, which figures out which type to create.

Declared at: llvm/include/llvm/Object/Wasm.h:120

Inherits from: ObjectFile

Member Variables

private wasm::WasmObjectHeader Header
private std::vector<WasmSection> Sections
private wasm::WasmDylinkInfo DylinkInfo
private wasm::WasmProducerInfo ProducerInfo
private std::vector<wasm::WasmFeatureEntry> TargetFeatures
private std::vector<wasm::WasmSignature> Signatures
private std::vector<wasm::WasmTable> Tables
private std::vector<wasm::WasmLimits> Memories
private std::vector<wasm::WasmGlobal> Globals
private std::vector<wasm::WasmTag> Tags
private std::vector<wasm::WasmImport> Imports
private std::vector<wasm::WasmExport> Exports
private std::vector<wasm::WasmElemSegment> ElemSegments
private std::vector<WasmSegment> DataSegments
private llvm::Optional<size_t> DataCount
private std::vector<wasm::WasmFunction> Functions
private std::vector<WasmSymbol> Symbols
private std::vector<wasm::WasmDebugName> DebugNames
private uint32_t StartFunction = -1
private bool HasLinkingSection = false
private bool HasMemory64 = false
private wasm::WasmLinkingData LinkingData
private uint32_t NumImportedGlobals = 0
private uint32_t NumImportedTables = 0
private uint32_t NumImportedFunctions = 0
private uint32_t NumImportedTags = 0
private uint32_t CodeSection = 0
private uint32_t DataSection = 0
private uint32_t TagSection = 0
private uint32_t GlobalSection = 0
private uint32_t TableSection = 0

Inherited from Binary:

protected Data

Method Overview

Inherited from ObjectFile:

Inherited from SymbolicFile:

Inherited from Binary:

Methods

WasmObjectFile(llvm::MemoryBufferRef Object,
               llvm::Error& Err)

Declared at: llvm/include/llvm/Object/Wasm.h:123

Parameters

llvm::MemoryBufferRef Object
llvm::Error& Err

static bool classof(const llvm::object::Binary* v)

Declared at: llvm/include/llvm/Object/Wasm.h:131

Parameters

const llvm::object::Binary* v

ArrayRef<llvm::object::WasmSegment> dataSegments()
    const

Declared at: llvm/include/llvm/Object/Wasm.h:149

ArrayRef<wasm::WasmDebugName> debugNames() const

Declared at: llvm/include/llvm/Object/Wasm.h:151

const wasm::WasmDylinkInfo& dylinkInfo() const

Declared at: llvm/include/llvm/Object/Wasm.h:133

ArrayRef<wasm::WasmElemSegment> elements() const

Declared at: llvm/include/llvm/Object/Wasm.h:148

ArrayRef<wasm::WasmExport> exports() const

Declared at: llvm/include/llvm/Object/Wasm.h:144

ArrayRef<wasm::WasmFunction> functions() const

Declared at: llvm/include/llvm/Object/Wasm.h:150

Triple::ArchType getArch() const

Declared at: llvm/include/llvm/Object/Wasm.h:205

uint8_t getBytesInAddress() const

Description

The number of bytes used to represent an address in this object file format.

Declared at: llvm/include/llvm/Object/Wasm.h:203

uint64_t getCommonSymbolSizeImpl(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:171

Parameters

llvm::object::DataRefImpl Symb

wasm::WasmFunction& getDefinedFunction(
    uint32_t Index)

Declared at: llvm/include/llvm/Object/Wasm.h:231

Parameters

uint32_t Index

const wasm::WasmFunction& getDefinedFunction(
    uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:232

Parameters

uint32_t Index

wasm::WasmGlobal& getDefinedGlobal(uint32_t Index)

Declared at: llvm/include/llvm/Object/Wasm.h:233

Parameters

uint32_t Index

wasm::WasmTag& getDefinedTag(uint32_t Index)

Declared at: llvm/include/llvm/Object/Wasm.h:234

Parameters

uint32_t Index

llvm::SubtargetFeatures getFeatures() const

Declared at: llvm/include/llvm/Object/Wasm.h:206

llvm::StringRef getFileFormatName() const

Declared at: llvm/include/llvm/Object/Wasm.h:204

const wasm::WasmObjectHeader& getHeader() const

Declared at: llvm/include/llvm/Object/Wasm.h:125

uint32_t getNumImportedFunctions() const

Declared at: llvm/include/llvm/Object/Wasm.h:155

uint32_t getNumImportedGlobals() const

Declared at: llvm/include/llvm/Object/Wasm.h:153

uint32_t getNumImportedTables() const

Declared at: llvm/include/llvm/Object/Wasm.h:154

uint32_t getNumImportedTags() const

Declared at: llvm/include/llvm/Object/Wasm.h:156

uint32_t getNumSections() const

Declared at: llvm/include/llvm/Object/Wasm.h:157

uint32_t getNumberOfSymbols() const

Declared at: llvm/include/llvm/Object/Wasm.h:147

const wasm::WasmProducerInfo& getProducerInfo()
    const

Declared at: llvm/include/llvm/Object/Wasm.h:134

uint64_t getRelocationOffset(
    llvm::object::DataRefImpl Rel) const

Declared at: llvm/include/llvm/Object/Wasm.h:195

Parameters

llvm::object::DataRefImpl Rel

llvm::object::symbol_iterator getRelocationSymbol(
    llvm::object::DataRefImpl Rel) const

Declared at: llvm/include/llvm/Object/Wasm.h:196

Parameters

llvm::object::DataRefImpl Rel

uint64_t getRelocationType(
    llvm::object::DataRefImpl Rel) const

Declared at: llvm/include/llvm/Object/Wasm.h:197

Parameters

llvm::object::DataRefImpl Rel

void getRelocationTypeName(
    llvm::object::DataRefImpl Rel,
    SmallVectorImpl<char>& Result) const

Declared at: llvm/include/llvm/Object/Wasm.h:198

Parameters

llvm::object::DataRefImpl Rel
SmallVectorImpl<char>& Result

uint64_t getSectionAddress(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:179

Parameters

llvm::object::DataRefImpl Sec

uint64_t getSectionAlignment(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:184

Parameters

llvm::object::DataRefImpl Sec

Expected<ArrayRef<uint8_t>> getSectionContents(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:183

Parameters

llvm::object::DataRefImpl Sec

uint64_t getSectionIndex(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:180

Parameters

llvm::object::DataRefImpl Sec

Expected<llvm::StringRef> getSectionName(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:178

Parameters

llvm::object::DataRefImpl Sec

uint64_t getSectionSize(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:181

Parameters

llvm::object::DataRefImpl Sec

Expected<uint64_t> getSymbolAddress(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:167

Parameters

llvm::object::DataRefImpl Symb

uint32_t getSymbolAlignment(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:170

Parameters

llvm::object::DataRefImpl Symb

Expected<uint32_t> getSymbolFlags(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:160

Parameters

llvm::object::DataRefImpl Symb

Expected<llvm::StringRef> getSymbolName(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:165

Parameters

llvm::object::DataRefImpl Symb

Expected<llvm::object::section_iterator>
getSymbolSection(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:173

Parameters

llvm::object::DataRefImpl Symb

uint32_t getSymbolSectionId(
    llvm::object::SymbolRef Sym) const

Declared at: llvm/include/llvm/Object/Wasm.h:174

Parameters

llvm::object::SymbolRef Sym

uint32_t getSymbolSectionIdImpl(
    const llvm::object::WasmSymbol& Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:238

Parameters

const llvm::object::WasmSymbol& Symb

Expected<SymbolRef::Type> getSymbolType(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:172

Parameters

llvm::object::DataRefImpl Symb

uint64_t getSymbolValueImpl(
    llvm::object::DataRefImpl Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:169

Parameters

llvm::object::DataRefImpl Symb

ArrayRef<wasm::WasmFeatureEntry>
getTargetFeatures() const

Declared at: llvm/include/llvm/Object/Wasm.h:135

const wasm::WasmRelocation& getWasmRelocation(
    llvm::object::DataRefImpl Ref) const

Declared at: llvm/include/llvm/Object/Wasm.h:237

Parameters

llvm::object::DataRefImpl Ref

const wasm::WasmRelocation& getWasmRelocation(
    const llvm::object::RelocationRef& Ref) const

Declared at: llvm/include/llvm/Object/Wasm.h:129

Parameters

const llvm::object::RelocationRef& Ref

const llvm::object::WasmSection& getWasmSection(
    const llvm::object::SectionRef& Section) const

Declared at: llvm/include/llvm/Object/Wasm.h:128

Parameters

const llvm::object::SectionRef& Section

const llvm::object::WasmSection& getWasmSection(
    llvm::object::DataRefImpl Ref) const

Declared at: llvm/include/llvm/Object/Wasm.h:236

Parameters

llvm::object::DataRefImpl Ref

const llvm::object::WasmSymbol& getWasmSymbol(
    const llvm::object::DataRefImpl& Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:126

Parameters

const llvm::object::DataRefImpl& Symb

const llvm::object::WasmSymbol& getWasmSymbol(
    const llvm::object::SymbolRef& Symbol) const

Declared at: llvm/include/llvm/Object/Wasm.h:127

Parameters

const llvm::object::SymbolRef& Symbol

uint64_t getWasmSymbolValue(
    const llvm::object::WasmSymbol& Sym) const

Declared at: llvm/include/llvm/Object/Wasm.h:168

Parameters

const llvm::object::WasmSymbol& Sym

ArrayRef<wasm::WasmGlobal> globals() const

Declared at: llvm/include/llvm/Object/Wasm.h:142

ArrayRef<wasm::WasmImport> imports() const

Declared at: llvm/include/llvm/Object/Wasm.h:139

bool isDefinedFunctionIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:218

Parameters

uint32_t Index

bool isDefinedGlobalIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:221

Parameters

uint32_t Index

bool isDefinedTableNumber(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:222

Parameters

uint32_t Index

bool isDefinedTagIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:224

Parameters

uint32_t Index

bool isRelocatableObject() const

Description

True if this is a relocatable object (.o/.obj).

Declared at: llvm/include/llvm/Object/Wasm.h:207

bool isSectionBSS(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:188

Parameters

llvm::object::DataRefImpl Sec

bool isSectionCompressed(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:185

Parameters

llvm::object::DataRefImpl Sec

bool isSectionData(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:187

Parameters

llvm::object::DataRefImpl Sec

bool isSectionText(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:186

Parameters

llvm::object::DataRefImpl Sec

bool isSectionVirtual(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:189

Parameters

llvm::object::DataRefImpl Sec

bool isSharedObject() const

Declared at: llvm/include/llvm/Object/Wasm.h:208

bool isValidDataSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:229

Parameters

uint32_t Index

bool isValidFunctionIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:217

Parameters

uint32_t Index

bool isValidFunctionSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:225

Parameters

uint32_t Index

bool isValidGlobalIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:219

Parameters

uint32_t Index

bool isValidGlobalSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:227

Parameters

uint32_t Index

bool isValidSectionSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:230

Parameters

uint32_t Index

bool isValidTableNumber(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:220

Parameters

uint32_t Index

bool isValidTableSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:226

Parameters

uint32_t Index

bool isValidTagIndex(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:223

Parameters

uint32_t Index

bool isValidTagSymbol(uint32_t Index) const

Declared at: llvm/include/llvm/Object/Wasm.h:228

Parameters

uint32_t Index

const wasm::WasmLinkingData& linkingData() const

Declared at: llvm/include/llvm/Object/Wasm.h:146

ArrayRef<wasm::WasmLimits> memories() const

Declared at: llvm/include/llvm/Object/Wasm.h:141

void moveRelocationNext(
    llvm::object::DataRefImpl& Rel) const

Declared at: llvm/include/llvm/Object/Wasm.h:194

Parameters

llvm::object::DataRefImpl& Rel

void moveSectionNext(
    llvm::object::DataRefImpl& Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:177

Parameters

llvm::object::DataRefImpl& Sec

void moveSymbolNext(
    llvm::object::DataRefImpl& Symb) const

Declared at: llvm/include/llvm/Object/Wasm.h:158

Parameters

llvm::object::DataRefImpl& Symb

llvm::Error parseCodeSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:254

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseCustomSection(
    llvm::object::WasmSection& Sec,
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:241

Parameters

llvm::object::WasmSection& Sec
llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseDataCountSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:256

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseDataSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:255

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseDylink0Section(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:260

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseDylinkSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:259

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseElemSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:253

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseExportSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:251

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseFunctionSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:246

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseGlobalSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:250

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseImportSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:245

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseLinkingSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:262

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseLinkingSectionComdat(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:264

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseLinkingSectionSymtab(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:263

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseMemorySection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:248

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseNameSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:261

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseProducersSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:265

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseRelocSection(
    llvm::StringRef Name,
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:267

Parameters

llvm::StringRef Name
llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseSection(
    llvm::object::WasmSection& Sec)

Declared at: llvm/include/llvm/Object/Wasm.h:240

Parameters

llvm::object::WasmSection& Sec

llvm::Error parseStartSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:252

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseTableSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:247

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseTagSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:249

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseTargetFeaturesSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:266

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::Error parseTypeSection(
    llvm::object::WasmObjectFile::ReadContext&
        Ctx)

Declared at: llvm/include/llvm/Object/Wasm.h:244

Parameters

llvm::object::WasmObjectFile::ReadContext& Ctx

llvm::object::section_iterator section_begin()
    const

Declared at: llvm/include/llvm/Object/Wasm.h:201

llvm::object::section_iterator section_end() const

Declared at: llvm/include/llvm/Object/Wasm.h:202

llvm::object::relocation_iterator
section_rel_begin(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:190

Parameters

llvm::object::DataRefImpl Sec

llvm::object::relocation_iterator section_rel_end(
    llvm::object::DataRefImpl Sec) const

Declared at: llvm/include/llvm/Object/Wasm.h:191

Parameters

llvm::object::DataRefImpl Sec

uint32_t startFunction() const

Declared at: llvm/include/llvm/Object/Wasm.h:152

llvm::object::basic_symbol_iterator symbol_begin()
    const

Declared at: llvm/include/llvm/Object/Wasm.h:162

llvm::object::basic_symbol_iterator symbol_end()
    const

Declared at: llvm/include/llvm/Object/Wasm.h:164

ArrayRef<llvm::object::WasmSymbol> syms() const

Declared at: llvm/include/llvm/Object/Wasm.h:145

ArrayRef<wasm::WasmTable> tables() const

Declared at: llvm/include/llvm/Object/Wasm.h:140

ArrayRef<wasm::WasmTag> tags() const

Declared at: llvm/include/llvm/Object/Wasm.h:143

ArrayRef<wasm::WasmSignature> types() const

Declared at: llvm/include/llvm/Object/Wasm.h:138