summaryrefslogtreecommitdiff
path: root/include/llvm/Object
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-13 19:25:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-13 19:25:18 +0000
commitca089b24d48ef6fa8da2d0bb8c25bb802c4a95c0 (patch)
tree3a28a772df9b17aef34f49e3c727965ad28c0c93 /include/llvm/Object
parent9df3605dea17e84f8183581f6103bd0c79e2a606 (diff)
Notes
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/COFF.h3
-rw-r--r--include/llvm/Object/Wasm.h14
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;