-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathctrlengine.h
70 lines (56 loc) · 1.72 KB
/
ctrlengine.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
#ifndef CTRLENGINE_H
#define CTRLENGINE_H
/*
用于控制调度frontengine查找ast,compilerengine生成ll代码,
operatorengine生成库方法的调用代码,
然后传递给clvm执行引擎执行,取回结果。
使用上,应该在什么位置初始化比较好呢。
*/
#include <QtCore>
#include <llvm/ExecutionEngine/GenericValue.h>
namespace llvm {
class Module;
};
namespace clang {
class CompilerInstance;
class CompilerInvocation;
namespace driver {
class Driver;
};
};
class FrontEngine;
class CompilerEngine;
class OperatorEngine;
class ClvmEngine;
class ModuleManager;
class CtrlEngine
{
public:
CtrlEngine();
~CtrlEngine();
// 可能的方法
void * vm_new(QString klass, QVector<QVariant> uargs);
bool vm_delete(void *kthis, QString klass);
QVariant vm_call(void *kthis, QString klass, QString method, QVector<QVariant> uargs);
QVariant vm_static_call(QString klass, QString method, QVector<QVariant> uargs);
// 查找这个类中的enum的值。
int vm_enum(QString klass, QString enum_name);
// call _Zls6QDebugRK9QBitArray
QString vm_qdebug(void *kthis, QString klass);
// improve
// hot fix
QVariant vm_call_hotfix(void *kthis, QString klass, QString method, QVector<QVariant> uargs);
private:
llvm::Module* process_dargs(QVector<QVariant> &dargs);
public:
// 调度组件可能不需要这些组件,只管理调度问题。
clang::CompilerInstance *mcis = NULL;
clang::CompilerInvocation *mciv = NULL;
clang::driver::Driver *mdrv = NULL;
public:
FrontEngine *mfe = NULL;
CompilerEngine *mce = NULL;
ClvmEngine *mvme = NULL;
ModuleManager *mman = NULL;
};
#endif /* CTRLENGINE_H */