-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathllvm_svcs.h
42 lines (31 loc) · 1.22 KB
/
llvm_svcs.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
/* abstract away LLVM details from the rest of LLL */
#define LLVM_SVCS_CB_NOTE 0
#define LLVM_SVCS_CB_WARNING 1
#define LLVM_SVCS_CB_ERROR 2
#define LLVM_SVCS_DIALECT_UNSPEC 0
#define LLVM_SVCS_DIALECT_ATT 1
#define LLVM_SVCS_DIALECT_INTEL 2
#define LLVM_SVCS_CM_DEFAULT 0
#define LLVM_SVCS_CM_SMALL 1
#define LLVM_SVCS_CM_KERNEL 2
#define LLVM_SVCS_CM_MEDIUM 3
#define LLVM_SVCS_CM_LARGE 4
#define LLVM_SVCS_RM_STATIC 0
#define LLVM_SVCS_RM_PIC 1
#define LLVM_SVCS_RM_DYNAMIC_NO_PIC 2
/* misc */
void llvm_svcs_init(void);
void llvm_svcs_triplet_decompose(const char *triplet, string &arch,
string &subArch, string &vendor, string &os, string &environ,
string &objFormat);
/* assemble */
typedef void (*llvm_svcs_assemble_cb_type)(int type, const char *fileName,
int lineNum, const char *message);
int llvm_svcs_assemble(const char *src, int dialect, const char *triplet,
int codeModel, int relocMode, llvm_svcs_assemble_cb_type callback,
string &outBytes, string &err);
/* disassemble */
int llvm_svcs_disasm_single(const char *triplet, uint8_t *src,
int src_len, uint64_t addr, string &result, int &instrLen);
int llvm_svcs_disasm_lengths(const char *triplet, uint8_t *src,
int src_len, uint64_t addr, vector<int> &lengths);