blob: 78a43be21d479b0d73869f17b2e2fb073e3f9209 [file] [log] [blame]
Derek Schufff2af0602020-01-29 17:30:57 -08001//===- 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
17namespace llvm {
18namespace objcopy {
19namespace wasm {
20
21struct 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
29struct 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