comparison gen/elem.h @ 86:fd32135dca3e trunk

[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!! Lots of bugfixes. Added support for special foreach on strings. Added std.array, std.utf, std.ctype and std.uni to phobos. Changed all the .c files in the gen dir to .cpp (it *is* C++ after all)
author lindquist
date Sat, 03 Nov 2007 14:44:58 +0100
parents 339422268de1
children
comparison
equal deleted inserted replaced
85:f869c636a113 86:fd32135dca3e
1 #ifndef LLVMDC_GEN_ELEM_H 1 #ifndef LLVMDC_GEN_ELEM_H
2 #define LLVMDC_GEN_ELEM_H 2 #define LLVMDC_GEN_ELEM_H
3
4 #include "dvalue.h"
5 typedef DValue elem;
6
7 /*
3 8
4 #include "root.h" 9 #include "root.h"
5 #include "declaration.h" 10 #include "declaration.h"
6 #include "aggregate.h" 11 #include "aggregate.h"
12
13 struct DValue;
7 14
8 // represents a value. be it a constant literal, a variable etc. 15 // represents a value. be it a constant literal, a variable etc.
9 // maintains all the information for doing load/store appropriately 16 // maintains all the information for doing load/store appropriately
10 struct elem : Object 17 struct elem : Object
11 { 18 {
20 SLICE, 27 SLICE,
21 ARRAYLEN 28 ARRAYLEN
22 }; 29 };
23 30
24 public: 31 public:
25 elem(); 32 elem(Expression* e);
33 virtual ~elem();
34
35 Expression* exp;
26 36
27 llvm::Value* mem; 37 llvm::Value* mem;
28 llvm::Value* val; 38 llvm::Value* val;
29 llvm::Value* arg; 39 llvm::Value* arg;
30 int type; 40 int type;
39 FuncDeclaration* funcdecl; 49 FuncDeclaration* funcdecl;
40 50
41 llvm::Value* getValue(); 51 llvm::Value* getValue();
42 //llvm::Value* getMemory(); 52 //llvm::Value* getMemory();
43 53
54 DValue* dvalue;
55
44 bool isNull() {return !(mem || val);} 56 bool isNull() {return !(mem || val);}
45 }; 57 };
46 58
59 */
60
47 #endif // LLVMDC_GEN_ELEM_H 61 #endif // LLVMDC_GEN_ELEM_H