-
Notifications
You must be signed in to change notification settings - Fork 3
/
error_compiler.h
59 lines (42 loc) · 1.38 KB
/
error_compiler.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
#ifndef VAIVEN_VISITOR_HEADER_ERROR_COMPILER
#define VAIVEN_VISITOR_HEADER_ERROR_COMPILER
#include "type_info.h"
#include "value.h"
#include "asmjit/src/asmjit/asmjit.h"
namespace vaiven {
using asmjit::X86Compiler;
class ErrorCompiler {
public:
ErrorCompiler(X86Compiler& cc) : cc(cc),
hasIntTypeError(false), hasBoolTypeError(false), hasStringTypeError(false),
hasNoFuncError(false), hasNoVarError(false), hasDupVarError(false),
intTypeErrorLabel(cc.newLabel()), boolTypeErrorLabel(cc.newLabel()),
stringTypeErrorLabel(cc.newLabel()), noFuncErrorLabel(cc.newLabel()),
noVarErrorLabel(cc.newLabel()), dupVarErrorLabel(cc.newLabel()),
hasDoubleConvertableTypeError(false),
doubleConvertableTypeErrorLabel(cc.newLabel()) {}
void generateTypeErrorEpilog();
X86Compiler& cc;
void intTypeError();
void boolTypeError();
void stringTypeError();
void noFuncError();
void noVarError();
void dupVarError();
asmjit::Label intTypeErrorLabel;
bool hasIntTypeError;
asmjit::Label doubleConvertableTypeErrorLabel;
bool hasDoubleConvertableTypeError;
asmjit::Label boolTypeErrorLabel;
bool hasBoolTypeError;
asmjit::Label stringTypeErrorLabel;
bool hasStringTypeError;
asmjit::Label noFuncErrorLabel;
bool hasNoFuncError;
asmjit::Label noVarErrorLabel;
bool hasNoVarError;
asmjit::Label dupVarErrorLabel;
bool hasDupVarError;
};
}
#endif