-
Notifications
You must be signed in to change notification settings - Fork 644
/
aot_export.h
110 lines (80 loc) · 2.33 KB
/
aot_export.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
/**
* @file aot_export.h
*
* @brief This file defines the exported AOT compilation APIs
*/
#ifndef _AOT_EXPORT_H
#define _AOT_EXPORT_H
#include <stdint.h>
#include <stdbool.h>
#include "aot_comp_option.h"
#ifdef __cplusplus
extern "C" {
#endif
struct AOTCompData;
typedef struct AOTCompData *aot_comp_data_t;
struct AOTCompContext;
typedef struct AOTCompContext *aot_comp_context_t;
struct AOTObjectData;
typedef struct AOTObjectData *aot_obj_data_t;
aot_comp_data_t
aot_create_comp_data(void *wasm_module, const char *target_arch,
bool gc_enabled);
void
aot_destroy_comp_data(aot_comp_data_t comp_data);
#if WASM_ENABLE_DEBUG_AOT != 0
typedef void *dwarf_extractor_handle_t;
dwarf_extractor_handle_t
create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);
#endif
enum {
AOT_FORMAT_FILE,
AOT_OBJECT_FILE,
AOT_LLVMIR_UNOPT_FILE,
AOT_LLVMIR_OPT_FILE,
};
bool
aot_compiler_init(void);
void
aot_compiler_destroy(void);
aot_comp_context_t
aot_create_comp_context(aot_comp_data_t comp_data, aot_comp_option_t option);
void
aot_destroy_comp_context(aot_comp_context_t comp_ctx);
bool
aot_compile_wasm(aot_comp_context_t comp_ctx);
aot_obj_data_t
aot_obj_data_create(aot_comp_context_t comp_ctx);
void
aot_obj_data_destroy(aot_obj_data_t obj_data);
uint32_t
aot_get_aot_file_size(aot_comp_context_t comp_ctx, aot_comp_data_t comp_data,
aot_obj_data_t obj_data);
uint8_t *
aot_emit_aot_file_buf(aot_comp_context_t comp_ctx, aot_comp_data_t comp_data,
uint32_t *p_aot_file_size);
bool
aot_emit_aot_file_buf_ex(aot_comp_context_t comp_ctx, aot_comp_data_t comp_data,
aot_obj_data_t obj_data, uint8_t *aot_file_buf,
uint32_t aot_file_size);
bool
aot_emit_llvm_file(aot_comp_context_t comp_ctx, const char *file_name);
bool
aot_emit_object_file(aot_comp_context_t comp_ctx, const char *file_name);
bool
aot_emit_aot_file(aot_comp_context_t comp_ctx, aot_comp_data_t comp_data,
const char *file_name);
void
aot_destroy_aot_file(uint8_t *aot_file);
char *
aot_get_last_error();
uint32_t
aot_get_plt_table_size();
#ifdef __cplusplus
}
#endif
#endif /* end of _AOT_EXPORT_H */