LLVM  8.0.1
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::object::WasmObjectFile Class Reference

#include "llvm/Object/Wasm.h"

Inheritance diagram for llvm::object::WasmObjectFile:
Inheritance graph
[legend]
Collaboration diagram for llvm::object::WasmObjectFile:
Collaboration graph
[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
 
ArrayRef< wasm::WasmSignaturetypes () const
 
ArrayRef< uint32_tfunctionTypes () const
 
ArrayRef< wasm::WasmImportimports () const
 
ArrayRef< wasm::WasmTabletables () const
 
ArrayRef< wasm::WasmLimitsmemories () const
 
ArrayRef< wasm::WasmGlobalglobals () const
 
ArrayRef< wasm::WasmEventevents () const
 
ArrayRef< wasm::WasmExportexports () const
 
ArrayRef< WasmSymbolsyms () const
 
const wasm::WasmLinkingDatalinkingData () const
 
uint32_t getNumberOfSymbols () const
 
ArrayRef< wasm::WasmElemSegmentelements () const
 
ArrayRef< WasmSegmentdataSegments () const
 
ArrayRef< wasm::WasmFunctionfunctions () const
 
ArrayRef< wasm::WasmFunctionNamedebugNames () const
 
uint32_t startFunction () const
 
uint32_t getNumImportedGlobals () const
 
uint32_t getNumImportedFunctions () const
 
uint32_t getNumImportedEvents () const
 
void moveSymbolNext (DataRefImpl &Symb) const override
 
uint32_t getSymbolFlags (DataRefImpl Symb) const override
 
basic_symbol_iterator symbol_begin () const override
 
basic_symbol_iterator symbol_end () const override
 
Expected< StringRefgetSymbolName (DataRefImpl Symb) const override
 
Expected< uint64_t > getSymbolAddress (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
 
void moveSectionNext (DataRefImpl &Sec) const override
 
std::error_code getSectionName (DataRefImpl Sec, StringRef &Res) const override
 
uint64_t getSectionAddress (DataRefImpl Sec) const override
 
uint64_t getSectionIndex (DataRefImpl Sec) const override
 
uint64_t getSectionSize (DataRefImpl Sec) const override
 
std::error_code getSectionContents (DataRefImpl Sec, StringRef &Res) 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
 
bool isSectionBitcode (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. More...
 
StringRef getFileFormatName () const override
 
Triple::ArchType getArch () const override
 
SubtargetFeatures getFeatures () const override
 
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj). More...
 
bool isSharedObject () const
 
- Public Member Functions inherited from llvm::object::ObjectFile
 ObjectFile ()=delete
 
 ObjectFile (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 void setARMSubArch (Triple &TheTriple) const
 
virtual Expected< uint64_t > getStartAddress () const
 
Triple makeTriple () const
 Create a triple from the data in this object file. More...
 
virtual std::error_code getBuildAttributes (ARMAttributeParser &Attributes) const
 
virtual StringRef mapDebugSectionName (StringRef Name) const
 Maps a debug section name to a standard DWARF section name. More...
 
- 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 ()
 
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 isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isWasm () const
 
bool isCOFFImportFile () const
 
bool isIR () const
 
bool isLittleEndian () const
 
bool isWinRes () 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)
 
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 > > createELFObjectFile (MemoryBufferRef Object)
 
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
 
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile (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)
 
static Expected< std::unique_ptr< SymbolicFile > > createSymbolicFile (MemoryBufferRef Object)
 
static Expected< OwningBinary< SymbolicFile > > createSymbolicFile (StringRef ObjectPath)
 
static bool classof (const Binary *v)
 
- Static Public Member Functions inherited from llvm::object::Binary
static std::error_code 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_WinRes, ID_StartObjects, ID_COFF, ID_ELF32L,
  ID_ELF32B, ID_ELF64L, ID_ELF64B, ID_MachO32L,
  ID_MachO32B, ID_MachO64L, ID_MachO64B, ID_Wasm,
  ID_EndObjects
}
 
- Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBufferRef Source)
 
const uint8_t * base () const
 
std::error_code printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
 
virtual bool isSectionStripped (DataRefImpl Sec) const
 
virtual bool isBerkeleyText (DataRefImpl Sec) const
 
virtual bool isBerkeleyData (DataRefImpl Sec) const
 
virtual section_iterator getRelocatedSection (DataRefImpl Sec) const
 
uint64_t getSymbolValue (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 119 of file Wasm.h.

Constructor & Destructor Documentation

◆ WasmObjectFile()

WasmObjectFile::WasmObjectFile ( MemoryBufferRef  Object,
Error Err 
)

Definition at line 247 of file WasmObjectFile.cpp.

Member Function Documentation

◆ classof()

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

Definition at line 130 of file Wasm.h.

References llvm::object::Binary::isWasm().

◆ dataSegments()

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

Definition at line 145 of file Wasm.h.

◆ debugNames()

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

Definition at line 147 of file Wasm.h.

◆ dylinkInfo()

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

Definition at line 132 of file Wasm.h.

◆ elements()

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

Definition at line 144 of file Wasm.h.

◆ events()

ArrayRef<wasm::WasmEvent> llvm::object::WasmObjectFile::events ( ) const
inline

Definition at line 139 of file Wasm.h.

◆ exports()

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

Definition at line 140 of file Wasm.h.

◆ functions()

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

Definition at line 146 of file Wasm.h.

◆ functionTypes()

ArrayRef<uint32_t> llvm::object::WasmObjectFile::functionTypes ( ) const
inline

Definition at line 134 of file Wasm.h.

◆ getArch()

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

Implements llvm::object::ObjectFile.

Definition at line 1427 of file WasmObjectFile.cpp.

References llvm::Triple::wasm32.

◆ 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 1423 of file WasmObjectFile.cpp.

◆ getCommonSymbolSizeImpl()

uint64_t WasmObjectFile::getCommonSymbolSizeImpl ( DataRefImpl  Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1225 of file WasmObjectFile.cpp.

References llvm_unreachable.

◆ getFeatures()

SubtargetFeatures WasmObjectFile::getFeatures ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1429 of file WasmObjectFile.cpp.

◆ getFileFormatName()

StringRef WasmObjectFile::getFileFormatName ( ) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1425 of file WasmObjectFile.cpp.

◆ getHeader()

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

Definition at line 1144 of file WasmObjectFile.cpp.

◆ getNumberOfSymbols()

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

Definition at line 143 of file Wasm.h.

◆ getNumImportedEvents()

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

Definition at line 151 of file Wasm.h.

References getFeatures(), getSymbolName(), and getSymbolType().

◆ getNumImportedFunctions()

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

Definition at line 150 of file Wasm.h.

◆ getNumImportedGlobals()

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

Definition at line 149 of file Wasm.h.

◆ getRelocationOffset()

uint64_t WasmObjectFile::getRelocationOffset ( DataRefImpl  Rel) const
overridevirtual

◆ getRelocationSymbol()

symbol_iterator WasmObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
overridevirtual

◆ 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

Implements llvm::object::ObjectFile.

Definition at line 1312 of file WasmObjectFile.cpp.

◆ getSectionAlignment()

uint64_t WasmObjectFile::getSectionAlignment ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1333 of file WasmObjectFile.cpp.

◆ getSectionContents()

std::error_code WasmObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const
overridevirtual

◆ getSectionIndex()

uint64_t WasmObjectFile::getSectionIndex ( DataRefImpl  Sec) const
overridevirtual

◆ getSectionName()

std::error_code WasmObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const
overridevirtual

◆ getSectionSize()

uint64_t WasmObjectFile::getSectionSize ( DataRefImpl  Sec) const
overridevirtual

◆ getSymbolAddress()

Expected< uint64_t > WasmObjectFile::getSymbolAddress ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolAlignment()

uint32_t WasmObjectFile::getSymbolAlignment ( DataRefImpl  Symb) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 1220 of file WasmObjectFile.cpp.

References llvm_unreachable.

◆ getSymbolFlags()

uint32_t WasmObjectFile::getSymbolFlags ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolName()

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

◆ getSymbolSection()

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

◆ getSymbolType()

Expected< SymbolRef::Type > WasmObjectFile::getSymbolType ( DataRefImpl  Symb) const
overridevirtual

◆ getSymbolValueImpl()

uint64_t WasmObjectFile::getSymbolValueImpl ( DataRefImpl  Symb) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1216 of file WasmObjectFile.cpp.

References getWasmSymbol(), and getWasmSymbolValue().

◆ getWasmRelocation()

const wasm::WasmRelocation & WasmObjectFile::getWasmRelocation ( const RelocationRef Ref) const

◆ getWasmSection()

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

◆ getWasmSymbol() [1/2]

const WasmSymbol & WasmObjectFile::getWasmSymbol ( const DataRefImpl Symb) const

◆ getWasmSymbol() [2/2]

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

◆ getWasmSymbolValue()

uint64_t WasmObjectFile::getWasmSymbolValue ( const WasmSymbol Sym) const

◆ globals()

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

Definition at line 138 of file Wasm.h.

◆ imports()

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

Definition at line 135 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 1433 of file WasmObjectFile.cpp.

◆ isSectionBitcode()

bool WasmObjectFile::isSectionBitcode ( DataRefImpl  Sec) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 1353 of file WasmObjectFile.cpp.

◆ isSectionBSS()

bool WasmObjectFile::isSectionBSS ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1349 of file WasmObjectFile.cpp.

◆ isSectionCompressed()

bool WasmObjectFile::isSectionCompressed ( DataRefImpl  Sec) const
overridevirtual

Implements llvm::object::ObjectFile.

Definition at line 1337 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 1351 of file WasmObjectFile.cpp.

◆ isSharedObject()

bool WasmObjectFile::isSharedObject ( ) const

◆ linkingData()

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

Definition at line 142 of file Wasm.h.

◆ memories()

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

Definition at line 137 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

◆ section_end()

section_iterator WasmObjectFile::section_end ( ) const
overridevirtual

◆ section_rel_begin()

relocation_iterator WasmObjectFile::section_rel_begin ( DataRefImpl  Sec) const
overridevirtual

◆ section_rel_end()

relocation_iterator WasmObjectFile::section_rel_end ( DataRefImpl  Sec) const
overridevirtual

◆ startFunction()

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

Definition at line 148 of file Wasm.h.

◆ symbol_begin()

basic_symbol_iterator WasmObjectFile::symbol_begin ( ) const
overridevirtual

◆ symbol_end()

basic_symbol_iterator WasmObjectFile::symbol_end ( ) const
overridevirtual

◆ syms()

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

Definition at line 141 of file Wasm.h.

◆ tables()

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

Definition at line 136 of file Wasm.h.

◆ types()

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

Definition at line 133 of file Wasm.h.


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