Derek Schuff | f2af060 | 2020-01-29 17:30:57 -0800 | [diff] [blame] | 1 | //===- Object.h -------------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef LLVM_TOOLS_LLVM_OBJCOPY_WASM_OBJECT_H |
| 10 | #define LLVM_TOOLS_LLVM_OBJCOPY_WASM_OBJECT_H |
| 11 | |
| 12 | #include "llvm/ADT/ArrayRef.h" |
| 13 | #include "llvm/ADT/StringRef.h" |
| 14 | #include "llvm/Object/Wasm.h" |
| 15 | #include <vector> |
| 16 | |
| 17 | namespace llvm { |
| 18 | namespace objcopy { |
| 19 | namespace wasm { |
| 20 | |
| 21 | struct Section { |
| 22 | // For now, each section is only an opaque binary blob with no distinction |
| 23 | // between custom and known sections. |
| 24 | uint8_t SectionType; |
| 25 | StringRef Name; |
| 26 | ArrayRef<uint8_t> Contents; |
| 27 | }; |
| 28 | |
| 29 | struct Object { |
| 30 | llvm::wasm::WasmObjectHeader Header; |
| 31 | // For now don't discriminate between kinds of sections. |
| 32 | std::vector<Section> Sections; |
| 33 | }; |
| 34 | |
| 35 | } // end namespace wasm |
| 36 | } // end namespace objcopy |
| 37 | } // end namespace llvm |
| 38 | |
| 39 | #endif // LLVM_TOOLS_LLVM_OBJCOPY_WASM_OBJECT_H |