16 #ifndef LLVM_OBJECT_WASM_H 17 #define LLVM_OBJECT_WASM_H 23 #include "llvm/Config/llvm-config.h" 42 : Info(Info), GlobalType(GlobalType), EventType(EventType),
43 Signature(Signature) {}
98 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 134 return TargetFeatures;
155 void moveSymbolNext(
DataRefImpl &Symb)
const override;
165 uint64_t getWasmSymbolValue(
const WasmSymbol &Sym)
const;
166 uint64_t getSymbolValueImpl(
DataRefImpl Symb)
const override;
168 uint64_t getCommonSymbolSizeImpl(
DataRefImpl Symb)
const override;
173 void moveSectionNext(
DataRefImpl &Sec)
const override;
175 uint64_t getSectionAddress(
DataRefImpl Sec)
const override;
176 uint64_t getSectionIndex(
DataRefImpl Sec)
const override;
177 uint64_t getSectionSize(
DataRefImpl Sec)
const override;
179 getSectionContents(
DataRefImpl Sec)
const override;
180 uint64_t getSectionAlignment(
DataRefImpl Sec)
const override;
181 bool isSectionCompressed(
DataRefImpl Sec)
const override;
182 bool isSectionText(
DataRefImpl Sec)
const override;
183 bool isSectionData(
DataRefImpl Sec)
const override;
185 bool isSectionVirtual(
DataRefImpl Sec)
const override;
186 bool isSectionBitcode(
DataRefImpl Sec)
const override;
191 void moveRelocationNext(
DataRefImpl &Rel)
const override;
192 uint64_t getRelocationOffset(
DataRefImpl Rel)
const override;
194 uint64_t getRelocationType(
DataRefImpl Rel)
const override;
200 uint8_t getBytesInAddress()
const override;
201 StringRef getFileFormatName()
const override;
204 bool isRelocatableObject()
const override;
205 bool isSharedObject()
const;
262 std::vector<WasmSection> Sections;
265 std::vector<wasm::WasmFeatureEntry> TargetFeatures;
266 std::vector<wasm::WasmSignature> Signatures;
267 std::vector<uint32_t> FunctionTypes;
268 std::vector<wasm::WasmTable> Tables;
269 std::vector<wasm::WasmLimits> Memories;
270 std::vector<wasm::WasmGlobal> Globals;
271 std::vector<wasm::WasmEvent> Events;
272 std::vector<wasm::WasmImport> Imports;
273 std::vector<wasm::WasmExport> Exports;
274 std::vector<wasm::WasmElemSegment> ElemSegments;
275 std::vector<WasmSegment> DataSegments;
277 std::vector<wasm::WasmFunction> Functions;
278 std::vector<WasmSymbol> Symbols;
279 std::vector<wasm::WasmFunctionName> DebugNames;
281 bool HasLinkingSection =
false;
282 bool HasDylinkSection =
false;
283 bool SeenCodeSection =
false;
299 WASM_SEC_ORDER_NONE = 0,
337 static int DisallowedPredecessors[WASM_NUM_SEC_ORDERS][WASM_NUM_SEC_ORDERS];
339 bool isValidSectionOrder(
unsigned ID,
StringRef CustomSectionName =
"");
342 bool Seen[WASM_NUM_SEC_ORDERS] = {};
345 int getSectionOrder(
unsigned ID,
StringRef CustomSectionName =
"");
357 #endif // LLVM_OBJECT_WASM_H const wasm::WasmLinkingData & linkingData() const
raw_ostream & operator<<(raw_ostream &OS, const SectionedAddress &Addr)
const wasm::WasmDylinkInfo & dylinkInfo() const
bool isTypeSection() const
ArrayRef< WasmSegment > dataSegments() const
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
ArrayRef< wasm::WasmExport > exports() const
const unsigned WASM_SYMBOL_BINDING_LOCAL
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
uint32_t getNumberOfSymbols() const
bool isTypeGlobal() const
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
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::WasmFeatureEntry > getTargetFeatures() const
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
static FeatureBitset getFeatures(StringRef CPU, StringRef FS, ArrayRef< SubtargetSubTypeKV > ProcDesc, ArrayRef< SubtargetFeatureKV > ProcFeatures)
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::WasmProducerInfo & getProducerInfo() const
const wasm::WasmGlobalType * GlobalType
const wasm::WasmSignature * Signature
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.
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