17 #ifndef LLVM_OBJECT_WASM_H 18 #define LLVM_OBJECT_WASM_H 24 #include "llvm/Config/llvm-config.h" 43 : Info(Info), GlobalType(GlobalType), EventType(EventType),
44 Signature(Signature) {}
99 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 153 void moveSymbolNext(
DataRefImpl &Symb)
const override;
163 uint64_t getWasmSymbolValue(
const WasmSymbol &Sym)
const;
164 uint64_t getSymbolValueImpl(
DataRefImpl Symb)
const override;
166 uint64_t getCommonSymbolSizeImpl(
DataRefImpl Symb)
const override;
171 void moveSectionNext(
DataRefImpl &Sec)
const override;
174 uint64_t getSectionAddress(
DataRefImpl Sec)
const override;
175 uint64_t getSectionIndex(
DataRefImpl Sec)
const override;
176 uint64_t getSectionSize(
DataRefImpl Sec)
const override;
177 std::error_code getSectionContents(
DataRefImpl Sec,
179 uint64_t getSectionAlignment(
DataRefImpl Sec)
const override;
180 bool isSectionCompressed(
DataRefImpl Sec)
const override;
181 bool isSectionText(
DataRefImpl Sec)
const override;
182 bool isSectionData(
DataRefImpl Sec)
const override;
184 bool isSectionVirtual(
DataRefImpl Sec)
const override;
185 bool isSectionBitcode(
DataRefImpl Sec)
const override;
190 void moveRelocationNext(
DataRefImpl &Rel)
const override;
191 uint64_t getRelocationOffset(
DataRefImpl Rel)
const override;
193 uint64_t getRelocationType(
DataRefImpl Rel)
const override;
199 uint8_t getBytesInAddress()
const override;
200 StringRef getFileFormatName()
const override;
203 bool isRelocatableObject()
const override;
204 bool isSharedObject()
const;
258 std::vector<WasmSection> Sections;
260 std::vector<wasm::WasmSignature> Signatures;
261 std::vector<uint32_t> FunctionTypes;
262 std::vector<wasm::WasmTable> Tables;
263 std::vector<wasm::WasmLimits> Memories;
264 std::vector<wasm::WasmGlobal> Globals;
265 std::vector<wasm::WasmEvent> Events;
266 std::vector<wasm::WasmImport> Imports;
267 std::vector<wasm::WasmExport> Exports;
268 std::vector<wasm::WasmElemSegment> ElemSegments;
269 std::vector<WasmSegment> DataSegments;
270 std::vector<wasm::WasmFunction> Functions;
271 std::vector<WasmSymbol> Symbols;
272 std::vector<wasm::WasmFunctionName> DebugNames;
274 bool HasLinkingSection =
false;
275 bool HasDylinkSection =
false;
292 WASM_SEC_ORDER_TYPE = 1,
293 WASM_SEC_ORDER_IMPORT = 2,
294 WASM_SEC_ORDER_FUNCTION = 3,
295 WASM_SEC_ORDER_TABLE = 4,
296 WASM_SEC_ORDER_MEMORY = 5,
297 WASM_SEC_ORDER_GLOBAL = 6,
298 WASM_SEC_ORDER_EVENT = 7,
299 WASM_SEC_ORDER_EXPORT = 8,
300 WASM_SEC_ORDER_START = 9,
301 WASM_SEC_ORDER_ELEM = 10,
302 WASM_SEC_ORDER_DATACOUNT = 11,
303 WASM_SEC_ORDER_CODE = 12,
304 WASM_SEC_ORDER_DATA = 13,
308 WASM_SEC_ORDER_DYLINK = 0,
310 WASM_SEC_ORDER_LINKING = 100,
312 WASM_SEC_ORDER_RELOC = 101,
315 WASM_SEC_ORDER_NAME = 102,
317 WASM_SEC_ORDER_PRODUCERS = 103
320 bool isValidSectionOrder(
unsigned ID,
StringRef CustomSectionName =
"");
326 int getSectionOrder(
unsigned ID,
StringRef CustomSectionName =
"");
338 #endif // LLVM_OBJECT_WASM_H const wasm::WasmLinkingData & linkingData() const
const wasm::WasmDylinkInfo & dylinkInfo() const
bool isTypeSection() const
ArrayRef< WasmSegment > dataSegments() const
This class represents lattice values for constants.
ArrayRef< wasm::WasmExport > exports() const
const unsigned WASM_SYMBOL_BINDING_LOCAL
uint32_t getNumberOfSymbols() const
bool isTypeGlobal() const
static const char * getPtr(const MachOObjectFile &O, size_t Offset)
ArrayRef< wasm::WasmImport > imports() const
This class is the base class for all object file types.
ArrayRef< uint32_t > functionTypes() const
ArrayRef< wasm::WasmFunctionName > debugNames() const
uint32_t getNumImportedGlobals() const
uint32_t getNumImportedFunctions() const
bool isBindingGlobal() const
unsigned getBinding() const
const unsigned WASM_SYMBOL_UNDEFINED
std::vector< wasm::WasmRelocation > Relocations
amdgpu Simplify well known AMD library false Value Value const Twine & Name
static StringRef getSymbolName(SymbolKind SymKind)
ArrayRef< wasm::WasmFunction > functions() const
This is a value type class that represents a single relocation in the list of relocations in the obje...
The access may reference the value stored in memory.
ArrayRef< wasm::WasmLimits > memories() const
Tagged union holding either a T or a Error.
ArrayRef< wasm::WasmTable > tables() const
static bool classof(const Binary *v)
unsigned getVisibility() const
wasm::WasmDataSegment Data
ArrayRef< wasm::WasmSignature > types() const
uint32_t getNumImportedEvents() const
bool isBindingLocal() const
LLVM_DUMP_METHOD void dump() const
ArrayRef< uint8_t > Content
The instances of the Type class are immutable: once they are created, they are never changed...
const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN
const wasm::WasmEventType * EventType
ArrayRef< wasm::WasmElemSegment > elements() const
const unsigned WASM_SYMBOL_BINDING_WEAK
ArrayRef< wasm::WasmGlobal > globals() const
const unsigned WASM_SYMBOL_VISIBILITY_MASK
uint32_t startFunction() const
const unsigned WASM_SYMBOL_BINDING_GLOBAL
const wasm::WasmSymbolInfo & Info
ArrayRef< WasmSymbol > syms() const
bool isTypeFunction() const
Manages the enabling and disabling of subtarget specific features.
This is a value type class that represents a single symbol in the list of symbols in the object file...
static std::unique_ptr< PDBSymbol > getSymbolType(const PDBSymbol &Symbol)
WasmSymbol(const wasm::WasmSymbolInfo &Info, const wasm::WasmGlobalType *GlobalType, const wasm::WasmEventType *EventType, const wasm::WasmSignature *Signature)
const unsigned WASM_SYMBOL_BINDING_MASK
const wasm::WasmGlobalType * GlobalType
const wasm::WasmSignature * Signature
OStream & operator<<(OStream &OS, const DataRefImpl &D)
ArrayRef< wasm::WasmEvent > events() const
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
static FeatureBitset getFeatures(StringRef CPU, StringRef FS, ArrayRef< SubtargetFeatureKV > ProcDesc, ArrayRef< SubtargetFeatureKV > ProcFeatures)
bool isBindingWeak() const
This is a value type class that represents a single section in the list of sections in the object fil...
void print(raw_ostream &Out) const