1
|
1 #ifndef LLVMDC_GEN_ELEM_H
|
|
2 #define LLVMDC_GEN_ELEM_H
|
|
3
|
|
4 #include "llvm/Value.h"
|
|
5
|
|
6 #include "root.h"
|
|
7 #include "declaration.h"
|
|
8 #include "aggregate.h"
|
|
9
|
|
10 // represents a value. be it a constant literal, a variable etc.
|
|
11 // maintains all the information for doing load/store appropriately
|
|
12 struct elem : Object
|
|
13 {
|
|
14 enum {
|
|
15 NONE,
|
|
16 VAR,
|
|
17 VAL,
|
|
18 FUNC,
|
|
19 CONST,
|
|
20 NUL,
|
|
21 REF,
|
|
22 SLICE
|
|
23 };
|
|
24
|
|
25 public:
|
|
26 elem();
|
|
27
|
|
28 llvm::Value* mem;
|
|
29 llvm::Value* val;
|
|
30 llvm::Value* arg;
|
|
31 int type;
|
|
32 bool inplace;
|
|
33 bool field;
|
|
34
|
|
35 VarDeclaration* vardecl;
|
|
36 FuncDeclaration* funcdecl;
|
|
37
|
|
38 llvm::Value* getValue();
|
|
39 //llvm::Value* getMemory();
|
|
40
|
|
41 bool isNull() {return !(mem || val);}
|
|
42 };
|
|
43
|
|
44 #endif // LLVMDC_GEN_ELEM_H
|