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