-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclvm.h
More file actions
67 lines (52 loc) · 1.54 KB
/
clvm.h
File metadata and controls
67 lines (52 loc) · 1.54 KB
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
#ifndef CLVM_H
#define CLVM_H
#include "fix_clang_undef_eai.h"
#include <QThread>
#include <llvm/ExecutionEngine/GenericValue.h>
namespace llvm {
struct GenericValue;
class ExecutionEngine;
class EngineBuilder;
class Module;
};
namespace clang {
class CompilerInvocation;
class CompilerInstance;
namespace driver {
class Driver;
};
};
/////
class ClvmJitListener;
/////
llvm::GenericValue vm_execute(QString code, QVector<llvm::GenericValue> &envp);
void *jit_vm_new(QString klass, QVector<QVariant> args);
QVariant jit_vm_call(void *kthis, QString klass, QString method, QVector<QVariant> args);
class Clvm : public QThread
{
Q_OBJECT;
public:
Clvm();
virtual ~Clvm();
llvm::GenericValue execute(QString &code, std::vector<llvm::GenericValue> & args,
QString func_entry);
llvm::GenericValue execute2(llvm::Module *mod, QString func_entry);
virtual void run();
public slots:
void deleteAsync(QString klass_name, void *obj);
private:
bool init();
bool initCompiler();
bool initExecutionEngine();
llvm::GenericValue run_module_func(llvm::Module *mod, std::vector<llvm::GenericValue> & args,
QString func_entry);
public:
llvm::GenericValue mretgv;
llvm::ExecutionEngine *mexe = NULL;
llvm::EngineBuilder *meb = NULL;
clang::CompilerInstance *mcis = NULL;
clang::CompilerInvocation *mciv = NULL;
clang::driver::Driver *mdrv = NULL;
ClvmJitListener *mlsner = NULL;
};
#endif /* CLVM_H */