diff options
Diffstat (limited to 'include/llvm/Object')
-rw-r--r-- | include/llvm/Object/COFF.h | 3 | ||||
-rw-r--r-- | include/llvm/Object/Wasm.h | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h index 78e0b5f6ed306..89c1ba6be35f0 100644 --- a/include/llvm/Object/COFF.h +++ b/include/llvm/Object/COFF.h @@ -698,6 +698,9 @@ struct coff_resource_dir_entry { uint32_t getNameOffset() const { return maskTrailingOnes<uint32_t>(31) & NameOffset; } + // Even though the PE/COFF spec doesn't mention this, the high bit of a name + // offset is set. + void setNameOffset(uint32_t Offset) { NameOffset = Offset | (1 << 31); } } Identifier; union { support::ulittle32_t DataEntryOffset; diff --git a/include/llvm/Object/Wasm.h b/include/llvm/Object/Wasm.h index 5c8445f10f448..07ee4a4d6c4da 100644 --- a/include/llvm/Object/Wasm.h +++ b/include/llvm/Object/Wasm.h @@ -61,7 +61,7 @@ public: void print(raw_ostream &Out) const { Out << "Name=" << Name << ", Type=" << static_cast<int>(Type) - << ", Flags=" << Flags; + << ", Flags=" << Flags << " ElemIndex=" << ElementIndex; } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) @@ -69,8 +69,7 @@ public: #endif }; -class WasmSection { -public: +struct WasmSection { WasmSection() = default; uint32_t Type = 0; // Section type (See below) @@ -80,6 +79,11 @@ public: std::vector<wasm::WasmRelocation> Relocations; // Relocations for this section }; +struct WasmSegment { + uint32_t SectionOffset; + wasm::WasmDataSegment Data; +}; + class WasmObjectFile : public ObjectFile { public: @@ -110,7 +114,7 @@ public: return ElemSegments; } - const std::vector<wasm::WasmDataSegment>& dataSegments() const { + const std::vector<WasmSegment>& dataSegments() const { return DataSegments; } @@ -210,7 +214,7 @@ private: std::vector<wasm::WasmImport> Imports; std::vector<wasm::WasmExport> Exports; std::vector<wasm::WasmElemSegment> ElemSegments; - std::vector<wasm::WasmDataSegment> DataSegments; + std::vector<WasmSegment> DataSegments; std::vector<wasm::WasmFunction> Functions; std::vector<WasmSymbol> Symbols; ArrayRef<uint8_t> CodeSection; |