Go to the documentation of this file.
16 #ifndef LLVM_OBJECT_WASM_H
17 #define LLVM_OBJECT_WASM_H
22 #include "llvm/Config/llvm-config.h"
99 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
136 return TargetFeatures;
270 std::vector<WasmSection> Sections;
273 std::vector<wasm::WasmFeatureEntry> TargetFeatures;
274 std::vector<wasm::WasmSignature> Signatures;
275 std::vector<wasm::WasmTable> Tables;
276 std::vector<wasm::WasmLimits> Memories;
277 std::vector<wasm::WasmGlobal> Globals;
278 std::vector<wasm::WasmTag> Tags;
279 std::vector<wasm::WasmImport> Imports;
280 std::vector<wasm::WasmExport> Exports;
281 std::vector<wasm::WasmElemSegment> ElemSegments;
282 std::vector<WasmSegment> DataSegments;
283 std::optional<size_t> DataCount;
284 std::vector<wasm::WasmFunction> Functions;
285 std::vector<WasmSymbol> Symbols;
286 std::vector<wasm::WasmDebugName> DebugNames;
288 bool HasLinkingSection =
false;
289 bool HasDylinkSection =
false;
290 bool HasMemory64 =
false;
354 int getSectionOrder(
unsigned ID,
StringRef CustomSectionName =
"");
366 #endif // LLVM_OBJECT_WASM_H
@ WASM_SYMBOL_TYPE_SECTION
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
const wasm::WasmLinkingData & linkingData() const
This is an optimization pass for GlobalISel generic memory operations.
WasmObjectFile(MemoryBufferRef Object, Error &Err)
basic_symbol_iterator symbol_begin() const override
ArrayRef< wasm::WasmDebugName > debugNames() const
ArrayRef< uint8_t > Content
ArrayRef< WasmSymbol > syms() const
uint8_t getBytesInAddress() const override
The number of bytes used to represent an address in this object file format.
bool isValidSectionOrder(unsigned ID, StringRef CustomSectionName="")
const wasm::WasmSymbolInfo & Info
wasm::WasmDataSegment Data
const unsigned WASM_SYMBOL_BINDING_LOCAL
@ WASM_SYMBOL_TYPE_GLOBAL
bool isTypeFunction() const
const wasm::WasmDylinkInfo & dylinkInfo() const
The instances of the Type class are immutable: once they are created, they are never changed.
bool isSectionCompressed(DataRefImpl Sec) const override
@ WASM_SEC_ORDER_TARGET_FEATURES
Expected< StringRef > getSectionName(DataRefImpl Sec) const override
const unsigned WASM_SYMBOL_UNDEFINED
ArrayRef< wasm::WasmLimits > memories() const
uint64_t getSymbolValueImpl(DataRefImpl Symb) const override
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
bool isSectionBSS(DataRefImpl Sec) const override
ArrayRef< wasm::WasmFunction > functions() const
ArrayRef< wasm::WasmSignature > types() const
Tagged union holding either a T or a Error.
uint32_t getNumImportedGlobals() const
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
Triple::ArchType getArch() const override
@ WASM_SEC_ORDER_DATACOUNT
uint32_t getNumberOfSymbols() const
uint32_t getNumSections() const
void moveSectionNext(DataRefImpl &Sec) const override
const unsigned WASM_SYMBOL_BINDING_WEAK
const wasm::WasmGlobalType * GlobalType
const wasm::WasmSignature * Signature
Expected< SubtargetFeatures > getFeatures() const override
@ Ref
The access may reference the value stored in memory.
const unsigned WASM_SYMBOL_VISIBILITY_MASK
const wasm::WasmRelocation & getWasmRelocation(const RelocationRef &Ref) const
const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN
bool isSectionText(DataRefImpl Sec) const override
uint32_t getSymbolAlignment(DataRefImpl Symb) const override
uint32_t getSymbolSectionId(SymbolRef Sym) const
uint32_t getNumImportedTags() const
Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const override
@ WASM_SEC_ORDER_PRODUCERS
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
@ WASM_SYMBOL_TYPE_FUNCTION
void moveRelocationNext(DataRefImpl &Rel) const override
ArrayRef< wasm::WasmFeatureEntry > getTargetFeatures() const
const wasm::WasmObjectHeader & getHeader() const
void print(raw_ostream &Out) const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
uint64_t getSectionIndex(DataRefImpl Sec) const override
ArrayRef< wasm::WasmElemSegment > elements() const
This is a value type class that represents a single section in the list of sections in the object fil...
bool isTypeSection() const
ArrayRef< wasm::WasmTable > tables() const
bar al al movzbl eax ret Missed when stored in a memory object
bool isBindingWeak() const
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
section_iterator section_begin() const override
ArrayRef< wasm::WasmImport > imports() const
Expected< uint32_t > getSymbolFlags(DataRefImpl Symb) const override
@ WASM_SEC_ORDER_FUNCTION
const wasm::WasmProducerInfo & getProducerInfo() const
uint32_t getNumImportedTables() const
uint64_t getSectionAddress(DataRefImpl Sec) const override
uint32_t startFunction() const
uint64_t getWasmSymbolValue(const WasmSymbol &Sym) const
bool isSharedObject() const
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
uint32_t getNumImportedFunctions() const
bool isBindingGlobal() const
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
Expected< ArrayRef< uint8_t > > getSectionContents(DataRefImpl Sec) const override
bool isTypeGlobal() const
const unsigned WASM_SYMBOL_BINDING_MASK
ArrayRef< wasm::WasmGlobal > globals() const
bool isSectionVirtual(DataRefImpl Sec) const override
bool isSectionData(DataRefImpl Sec) const override
uint64_t getSectionSize(DataRefImpl Sec) const override
WasmSymbol(const wasm::WasmSymbolInfo &Info, const wasm::WasmGlobalType *GlobalType, const wasm::WasmTableType *TableType, const wasm::WasmSignature *Signature)
const WasmSection & getWasmSection(const SectionRef &Section) const
ArrayRef< WasmSegment > dataSegments() const
uint64_t getSectionAlignment(DataRefImpl Sec) const override
void moveSymbolNext(DataRefImpl &Symb) const override
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override
unsigned getBinding() const
ArrayRef< wasm::WasmTag > tags() const
Lightweight error class with error context and mandatory checking.
const unsigned WASM_SYMBOL_BINDING_GLOBAL
const WasmSymbol & getWasmSymbol(const DataRefImpl &Symb) const
section_iterator section_end() const override
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
uint64_t getRelocationOffset(DataRefImpl Rel) const override
basic_symbol_iterator symbol_end() const override
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
const wasm::WasmTableType * TableType
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
ArrayRef< wasm::WasmExport > exports() const
unsigned getVisibility() const
This is a value type class that represents a single symbol in the list of symbols in the object file.
static bool classof(const Binary *v)
LLVM_DUMP_METHOD void dump() const
uint64_t getRelocationType(DataRefImpl Rel) const override
This is a value type class that represents a single relocation in the list of relocations in the obje...
static int DisallowedPredecessors[WASM_NUM_SEC_ORDERS][WASM_NUM_SEC_ORDERS]
relocation_iterator section_rel_end(DataRefImpl Sec) const override
std::vector< wasm::WasmRelocation > Relocations
StringRef getFileFormatName() const override
bool isBindingLocal() const