/src/WasmEdge/include/llvm/data.h
Line | Count | Source |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | //===-- wasmedge/llvm/data.h - Data class definition ----------------------===// |
5 | | // |
6 | | // Part of the WasmEdge Project. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | /// |
10 | | /// \file |
11 | | /// This file is the definition class of Data class. |
12 | | /// |
13 | | //===----------------------------------------------------------------------===// |
14 | | #pragma once |
15 | | |
16 | | #include "ast/module.h" |
17 | | #include "common/configure.h" |
18 | | #include "common/errcode.h" |
19 | | #include "common/filesystem.h" |
20 | | #include "common/span.h" |
21 | | |
22 | | #include <mutex> |
23 | | |
24 | | namespace WasmEdge::LLVM { |
25 | | |
26 | | /// Holds llvm-relative runtime data, like llvm::Context, llvm::Module, etc. |
27 | | class Data { |
28 | | public: |
29 | | struct DataContext; |
30 | | Data() noexcept; |
31 | | ~Data() noexcept; |
32 | | Data(Data &&) noexcept; |
33 | | Data &operator=(Data &&) noexcept; |
34 | 12.8k | DataContext &extract() noexcept { return *Context; } |
35 | | |
36 | | private: |
37 | | std::unique_ptr<DataContext> Context; |
38 | | const Configure Conf; |
39 | | }; |
40 | | |
41 | | } // namespace WasmEdge::LLVM |