LLVM 22.0.0git
llvm::object::WasmObjectFile Class Reference

#include "llvm/Object/Wasm.h"

Inheritance diagram for llvm::object::WasmObjectFile:
[legend]

Classes

struct  ReadContext

Public Member Functions

 WasmObjectFile (MemoryBufferRef Object, Error &Err)
const wasm::WasmObjectHeadergetHeader () const
const WasmSymbolgetWasmSymbol (const DataRefImpl &Symb) const
const WasmSymbolgetWasmSymbol (const SymbolRef &Symbol) const
const WasmSectiongetWasmSection (const SectionRef &Section) const
const wasm::WasmRelocationgetWasmRelocation (const RelocationRef &Ref) const
const wasm::WasmDylinkInfodylinkInfo () const
const wasm::WasmProducerInfogetProducerInfo () const
ArrayRef< wasm::WasmFeatureEntrygetTargetFeatures () const
ArrayRef< wasm::WasmSignaturetypes () const
ArrayRef< wasm::WasmImportimports () const
ArrayRef< wasm::WasmTabletables () const
ArrayRef< wasm::WasmLimitsmemories () const
ArrayRef< wasm::WasmGlobalglobals () const
ArrayRef< wasm::WasmTagtags () const
ArrayRef< wasm::WasmExportexports () const
const wasm::WasmLinkingDatalinkingData () const
uint32_t getNumberOfSymbols () const
ArrayRef< wasm::WasmElemSegmentelements () const
ArrayRef< WasmSegmentdataSegments () const
ArrayRef< wasm::WasmFunctionfunctions () const
ArrayRef< wasm::WasmDebugNamedebugNames () const
uint32_t startFunction () const
uint32_t getNumImportedGlobals () const
uint32_t getNumImportedTables () const
uint32_t getNumImportedFunctions () const
uint32_t getNumImportedTags () const
uint32_t getNumSections () const
void moveSymbolNext (DataRefImpl &Symb) const override
Expected< uint32_tgetSymbolFlags (DataRefImpl Symb) const override
basic_symbol_iterator symbol_begin () const override
basic_symbol_iterator symbol_end () const override
Expected< StringRefgetSymbolName (DataRefImpl Symb) const override
bool is64Bit () const override
Expected< uint64_tgetSymbolAddress (DataRefImpl Symb) const override
uint64_t getWasmSymbolValue (const WasmSymbol &Sym) const
uint64_t getSymbolValueImpl (DataRefImpl Symb) const override
uint32_t getSymbolAlignment (DataRefImpl Symb) const override
uint64_t getCommonSymbolSizeImpl (DataRefImpl Symb) const override
Expected< SymbolRef::TypegetSymbolType (DataRefImpl Symb) const override
Expected< section_iteratorgetSymbolSection (DataRefImpl Symb) const override
uint32_t getSymbolSectionId (SymbolRef Sym) const
uint32_t getSymbolSize (SymbolRef Sym) const
void moveSectionNext (DataRefImpl &Sec) const override
Expected< StringRefgetSectionName (DataRefImpl Sec) const override
uint64_t getSectionAddress (DataRefImpl Sec) const override
uint64_t getSectionIndex (DataRefImpl Sec) const override
uint64_t getSectionSize (DataRefImpl Sec) const override
Expected< ArrayRef< uint8_t > > getSectionContents (DataRefImpl Sec) const override
uint64_t getSectionAlignment (DataRefImpl Sec) const override
bool isSectionCompressed (DataRefImpl Sec) const override
bool isSectionText (DataRefImpl Sec) const override
bool isSectionData (DataRefImpl Sec) const override
bool isSectionBSS (DataRefImpl Sec) const override
bool isSectionVirtual (DataRefImpl Sec) const override
relocation_iterator section_rel_begin (DataRefImpl Sec) const override
relocation_iterator section_rel_end (DataRefImpl Sec) const override
void moveRelocationNext (DataRefImpl &Rel) const override
uint64_t getRelocationOffset (DataRefImpl Rel) const override
symbol_iterator getRelocationSymbol (DataRefImpl Rel) const override
uint64_t getRelocationType (DataRefImpl Rel) const override
void getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
section_iterator section_begin () const override
section_iterator section_end () const override
uint8_t getBytesInAddress () const override
 The number of bytes used to represent an address in this object file format.
StringRef getFileFormatName () const override
Triple::ArchType getArch () const override
Expected< SubtargetFeaturesgetFeatures () const override
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj).
bool isSharedObject () const
bool hasUnmodeledTypes () const
Public Member Functions inherited from llvm::object::ObjectFile
 ObjectFile ()=delete
 ObjectFile (const ObjectFile &other)=delete
ObjectFileoperator= (const ObjectFile &other)=delete
uint64_t getCommonSymbolSize (DataRefImpl Symb) const
virtual std::vector< SectionRefdynamic_relocation_sections () const
symbol_iterator_range symbols () const
section_iterator_range sections () const
virtual bool hasDebugInfo () const
virtual Triple::OSType getOS () const
virtual std::optional< StringReftryGetCPUName () const
virtual void setARMSubArch (Triple &TheTriple) const
virtual Expected< uint64_tgetStartAddress () const
Triple makeTriple () const
 Create a triple from the data in this object file.
virtual StringRef mapDebugSectionName (StringRef Name) const
 Maps a debug section name to a standard DWARF section name.
bool isReflectionSectionStrippable (llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind) const
 True if the reflection section can be stripped by the linker.
Public Member Functions inherited from llvm::object::SymbolicFile
 SymbolicFile (unsigned int Type, MemoryBufferRef Source)
 ~SymbolicFile () override
basic_symbol_iterator_range symbols () const
Public Member Functions inherited from llvm::object::Binary
 Binary ()=delete
 Binary (const Binary &other)=delete
virtual ~Binary ()
virtual Error initContent ()
StringRef getData () const
StringRef getFileName () const
MemoryBufferRef getMemoryBufferRef () const
unsigned int getType () const
bool isObject () const
bool isSymbolic () const
bool isArchive () const
bool isMachOUniversalBinary () const
bool isTapiUniversal () const
bool isELF () const
bool isMachO () const
bool isCOFF () const
bool isXCOFF () const
bool isWasm () const
bool isOffloadFile () const
bool isCOFFImportFile () const
bool isIR () const
bool isGOFF () const
bool isMinidump () const
bool isTapiFile () const
bool isLittleEndian () const
bool isWinRes () const
bool isDXContainer () const
Triple::ObjectFormatType getTripleObjectFormat () const

Static Public Member Functions

static bool classof (const Binary *v)
Static Public Member Functions inherited from llvm::object::ObjectFile
static Expected< OwningBinary< ObjectFile > > createObjectFile (StringRef ObjectPath)
static Expected< std::unique_ptr< ObjectFile > > createObjectFile (MemoryBufferRef Object, llvm::file_magic Type, bool InitContent=true)
static Expected< std::unique_ptr< ObjectFile > > createObjectFile (MemoryBufferRef Object)
static bool classof (const Binary *v)
static Expected< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile (MemoryBufferRef Object)
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile (MemoryBufferRef Object, unsigned FileType)
static Expected< std::unique_ptr< ObjectFile > > createELFObjectFile (MemoryBufferRef Object, bool InitContent=true)
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0)
 Create a MachOObjectFile instance from a given buffer.
static Expected< std::unique_ptr< ObjectFile > > createGOFFObjectFile (MemoryBufferRef Object)
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile (MemoryBufferRef Object)
static Expected< std::unique_ptr< DXContainerObjectFile > > createDXContainerObjectFile (MemoryBufferRef Object)
Static Public Member Functions inherited from llvm::object::SymbolicFile
static Expected< std::unique_ptr< SymbolicFile > > createSymbolicFile (MemoryBufferRef Object, llvm::file_magic Type, LLVMContext *Context, bool InitContent=true)
static Expected< std::unique_ptr< SymbolicFile > > createSymbolicFile (MemoryBufferRef Object)
static bool classof (const Binary *v)
static bool isSymbolicFile (file_magic Type, const LLVMContext *Context)
Static Public Member Functions inherited from llvm::object::Binary
static Error checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)

Additional Inherited Members

Public Types inherited from llvm::object::ObjectFile
using symbol_iterator_range = iterator_range<symbol_iterator>
using section_iterator_range = iterator_range<section_iterator>
Public Types inherited from llvm::object::SymbolicFile
using basic_symbol_iterator_range = iterator_range<basic_symbol_iterator>
Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive , ID_MachOUniversalBinary , ID_COFFImportFile , ID_IR ,
  ID_TapiUniversal , ID_TapiFile , ID_Minidump , ID_WinRes ,
  ID_Offload , ID_StartObjects , ID_COFF , ID_XCOFF32 ,
  ID_XCOFF64 , ID_ELF32L , ID_ELF32B , ID_ELF64L ,
  ID_ELF64B , ID_MachO32L , ID_MachO32B , ID_MachO64L ,
  ID_MachO64B , ID_GOFF , ID_Wasm , ID_DXContainer ,
  ID_EndObjects
}
Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBufferRef Source)
const uint8_tbase () const
Error printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
virtual bool isSectionBitcode (DataRefImpl Sec) const
virtual bool isSectionStripped (DataRefImpl Sec) const
virtual bool isBerkeleyText (DataRefImpl Sec) const
virtual bool isBerkeleyData (DataRefImpl Sec) const
virtual bool isDebugSection (DataRefImpl Sec) const
virtual Expected< section_iteratorgetRelocatedSection (DataRefImpl Sec) const
virtual llvm::binaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue (StringRef SectionName) const
Expected< uint64_tgetSymbolValue (DataRefImpl Symb) const
Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBufferRef Source)
Static Protected Member Functions inherited from llvm::object::Binary
static unsigned int getELFType (bool isLE, bool is64Bits)
static unsigned int getMachOType (bool isLE, bool is64Bits)
Protected Attributes inherited from llvm::object::Binary
MemoryBufferRef Data

Detailed Description

Definition at line 127 of file Wasm.h.

Constructor & Destructor Documentation

◆ WasmObjectFile()

Member Function Documentation

◆ classof()

bool llvm::object::WasmObjectFile::classof ( const Binary * v)
inlinestatic

Definition at line 138 of file Wasm.h.

◆ dataSegments()

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

Definition at line 155 of file Wasm.h.

◆ debugNames()

ArrayRef< wasm::WasmDebugName > llvm::object::WasmObjectFile::debugNames ( ) const
inline

Definition at line 157 of file Wasm.h.

◆ dylinkInfo()

const wasm::WasmDylinkInfo & llvm::object::WasmObjectFile::dylinkInfo ( ) const
inline

Definition at line 140 of file Wasm.h.

◆ elements()

ArrayRef< wasm::WasmElemSegment > llvm::object::WasmObjectFile::elements ( ) const
inline

Definition at line 154 of file Wasm.h.

◆ exports()

ArrayRef< wasm::WasmExport > llvm::object::WasmObjectFile::exports ( ) const
inline

Definition at line 151 of file Wasm.h.

◆ functions()

ArrayRef< wasm::WasmFunction > llvm::object::WasmObjectFile::functions ( ) const
inline

Definition at line 156 of file Wasm.h.

Referenced by getSymbolSize().

◆ getArch()

Triple::ArchType WasmObjectFile::getArch ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2115 of file WasmObjectFile.cpp.

References llvm::Triple::wasm32, and llvm::Triple::wasm64.

◆ getBytesInAddress()

uint8_t WasmObjectFile::getBytesInAddress ( ) const
overridevirtual

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

Implements llvm::object::ObjectFile.

Definition at line 2109 of file WasmObjectFile.cpp.

◆ getCommonSymbolSizeImpl()

uint64_t WasmObjectFile::getCommonSymbolSizeImpl ( DataRefImpl Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1906 of file WasmObjectFile.cpp.

References llvm_unreachable.

◆ getFeatures()

Expected< SubtargetFeatures > WasmObjectFile::getFeatures ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2119 of file WasmObjectFile.cpp.

◆ getFileFormatName()

StringRef WasmObjectFile::getFileFormatName ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2113 of file WasmObjectFile.cpp.

◆ getHeader()

const wasm::WasmObjectHeader & WasmObjectFile::getHeader ( ) const

Definition at line 1796 of file WasmObjectFile.cpp.

◆ getNumberOfSymbols()

uint32_t llvm::object::WasmObjectFile::getNumberOfSymbols ( ) const
inline

Definition at line 153 of file Wasm.h.

◆ getNumImportedFunctions()

uint32_t llvm::object::WasmObjectFile::getNumImportedFunctions ( ) const
inline

Definition at line 161 of file Wasm.h.

Referenced by getSymbolSize().

◆ getNumImportedGlobals()

uint32_t llvm::object::WasmObjectFile::getNumImportedGlobals ( ) const
inline

Definition at line 159 of file Wasm.h.

◆ getNumImportedTables()

uint32_t llvm::object::WasmObjectFile::getNumImportedTables ( ) const
inline

Definition at line 160 of file Wasm.h.

◆ getNumImportedTags()

uint32_t llvm::object::WasmObjectFile::getNumImportedTags ( ) const
inline

Definition at line 162 of file Wasm.h.

◆ getNumSections()

uint32_t llvm::object::WasmObjectFile::getNumSections ( ) const
inline

Definition at line 163 of file Wasm.h.

◆ getProducerInfo()

const wasm::WasmProducerInfo & llvm::object::WasmObjectFile::getProducerInfo ( ) const
inline

Definition at line 141 of file Wasm.h.

◆ getRelocationOffset()

uint64_t WasmObjectFile::getRelocationOffset ( DataRefImpl Rel) const
overridevirtual

◆ getRelocationSymbol()

◆ getRelocationType()

uint64_t WasmObjectFile::getRelocationType ( DataRefImpl Rel) const
overridevirtual

◆ getRelocationTypeName()

void WasmObjectFile::getRelocationTypeName ( DataRefImpl Rel,
SmallVectorImpl< char > & Result ) const
overridevirtual

◆ getSectionAddress()

uint64_t WasmObjectFile::getSectionAddress ( DataRefImpl Sec) const
overridevirtual

◆ getSectionAlignment()

uint64_t WasmObjectFile::getSectionAlignment ( DataRefImpl Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2021 of file WasmObjectFile.cpp.

◆ getSectionContents()

Expected< ArrayRef< uint8_t > > WasmObjectFile::getSectionContents ( DataRefImpl Sec) const
overridevirtual

◆ getSectionIndex()

uint64_t WasmObjectFile::getSectionIndex ( DataRefImpl Sec) const
overridevirtual

◆ getSectionName()

◆ getSectionSize()

uint64_t WasmObjectFile::getSectionSize ( DataRefImpl Sec) const
overridevirtual

◆ getSymbolAddress()

◆ getSymbolAlignment()

uint32_t WasmObjectFile::getSymbolAlignment ( DataRefImpl Symb) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 1901 of file WasmObjectFile.cpp.

References llvm_unreachable.

◆ getSymbolFlags()

◆ getSymbolName()

Expected< StringRef > WasmObjectFile::getSymbolName ( DataRefImpl Symb) const
overridevirtual

◆ getSymbolSection()

Expected< section_iterator > WasmObjectFile::getSymbolSection ( DataRefImpl Symb) const
overridevirtual

◆ getSymbolSectionId()

uint32_t WasmObjectFile::getSymbolSectionId ( SymbolRef Sym) const

Definition at line 1945 of file WasmObjectFile.cpp.

References getWasmSymbol(), and llvm::object::ObjectFile::SymbolRef.

◆ getSymbolSize()

◆ getSymbolType()

◆ getSymbolValueImpl()

uint64_t WasmObjectFile::getSymbolValueImpl ( DataRefImpl Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1897 of file WasmObjectFile.cpp.

References getWasmSymbol(), and getWasmSymbolValue().

◆ getTargetFeatures()

ArrayRef< wasm::WasmFeatureEntry > llvm::object::WasmObjectFile::getTargetFeatures ( ) const
inline

Definition at line 142 of file Wasm.h.

◆ getWasmRelocation()

◆ getWasmSection()

const WasmSection & WasmObjectFile::getWasmSection ( const SectionRef & Section) const

◆ getWasmSymbol() [1/2]

◆ getWasmSymbol() [2/2]

const WasmSymbol & WasmObjectFile::getWasmSymbol ( const SymbolRef & Symbol) const

◆ getWasmSymbolValue()

◆ globals()

ArrayRef< wasm::WasmGlobal > llvm::object::WasmObjectFile::globals ( ) const
inline

Definition at line 149 of file Wasm.h.

◆ hasUnmodeledTypes()

bool llvm::object::WasmObjectFile::hasUnmodeledTypes ( ) const
inline

Definition at line 218 of file Wasm.h.

◆ imports()

ArrayRef< wasm::WasmImport > llvm::object::WasmObjectFile::imports ( ) const
inline

Definition at line 146 of file Wasm.h.

◆ is64Bit()

bool llvm::object::WasmObjectFile::is64Bit ( ) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 173 of file Wasm.h.

◆ isRelocatableObject()

bool WasmObjectFile::isRelocatableObject ( ) const
overridevirtual

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

Implements llvm::object::ObjectFile.

Definition at line 2123 of file WasmObjectFile.cpp.

Referenced by getSectionAddress().

◆ isSectionBSS()

bool WasmObjectFile::isSectionBSS ( DataRefImpl Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2037 of file WasmObjectFile.cpp.

◆ isSectionCompressed()

bool WasmObjectFile::isSectionCompressed ( DataRefImpl Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2025 of file WasmObjectFile.cpp.

◆ isSectionData()

bool WasmObjectFile::isSectionData ( DataRefImpl Sec) const
overridevirtual

◆ isSectionText()

bool WasmObjectFile::isSectionText ( DataRefImpl Sec) const
overridevirtual

◆ isSectionVirtual()

bool WasmObjectFile::isSectionVirtual ( DataRefImpl Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2039 of file WasmObjectFile.cpp.

◆ isSharedObject()

bool WasmObjectFile::isSharedObject ( ) const

Definition at line 2125 of file WasmObjectFile.cpp.

Referenced by getSectionAddress().

◆ linkingData()

const wasm::WasmLinkingData & llvm::object::WasmObjectFile::linkingData ( ) const
inline

Definition at line 152 of file Wasm.h.

◆ memories()

ArrayRef< wasm::WasmLimits > llvm::object::WasmObjectFile::memories ( ) const
inline

Definition at line 148 of file Wasm.h.

◆ moveRelocationNext()

void WasmObjectFile::moveRelocationNext ( DataRefImpl & Rel) const
overridevirtual

◆ moveSectionNext()

void WasmObjectFile::moveSectionNext ( DataRefImpl & Sec) const
overridevirtual

◆ moveSymbolNext()

void WasmObjectFile::moveSymbolNext ( DataRefImpl & Symb) const
overridevirtual

◆ section_begin()

section_iterator WasmObjectFile::section_begin ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2097 of file WasmObjectFile.cpp.

References llvm::Ref, and llvm::object::ObjectFile::SectionRef.

◆ section_end()

section_iterator WasmObjectFile::section_end ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 2103 of file WasmObjectFile.cpp.

References llvm::Ref, and llvm::object::ObjectFile::SectionRef.

Referenced by getSymbolSection().

◆ section_rel_begin()

◆ section_rel_end()

◆ startFunction()

uint32_t llvm::object::WasmObjectFile::startFunction ( ) const
inline

Definition at line 158 of file Wasm.h.

◆ symbol_begin()

basic_symbol_iterator WasmObjectFile::symbol_begin ( ) const
overridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 1820 of file WasmObjectFile.cpp.

References llvm::Ref.

◆ symbol_end()

basic_symbol_iterator WasmObjectFile::symbol_end ( ) const
overridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 1827 of file WasmObjectFile.cpp.

References llvm::Ref.

Referenced by getRelocationSymbol().

◆ tables()

ArrayRef< wasm::WasmTable > llvm::object::WasmObjectFile::tables ( ) const
inline

Definition at line 147 of file Wasm.h.

◆ tags()

ArrayRef< wasm::WasmTag > llvm::object::WasmObjectFile::tags ( ) const
inline

Definition at line 150 of file Wasm.h.

◆ types()

ArrayRef< wasm::WasmSignature > llvm::object::WasmObjectFile::types ( ) const
inline

Definition at line 145 of file Wasm.h.


The documentation for this class was generated from the following files: