Mercurial > projects > ldc
annotate gen/elem.h @ 91:3f949c6e2e9d trunk
[svn r95] added support for mains like:
T main(string[] args)
fixed a bug with slicing a pointer that is an argument with no storage
author | lindquist |
---|---|
date | Wed, 07 Nov 2007 04:52:56 +0100 |
parents | fd32135dca3e |
children |
rev | line source |
---|---|
1 | 1 #ifndef LLVMDC_GEN_ELEM_H |
2 #define LLVMDC_GEN_ELEM_H | |
3 | |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
4 #include "dvalue.h" |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
5 typedef DValue elem; |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
6 |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
7 /* |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
8 |
1 | 9 #include "root.h" |
10 #include "declaration.h" | |
11 #include "aggregate.h" | |
12 | |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
13 struct DValue; |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
14 |
1 | 15 // represents a value. be it a constant literal, a variable etc. |
16 // maintains all the information for doing load/store appropriately | |
17 struct elem : Object | |
18 { | |
19 enum { | |
20 NONE, | |
21 VAR, | |
22 VAL, | |
23 FUNC, | |
24 CONST, | |
25 NUL, | |
26 REF, | |
34 | 27 SLICE, |
28 ARRAYLEN | |
1 | 29 }; |
30 | |
31 public: | |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
32 elem(Expression* e); |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
33 virtual ~elem(); |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
34 |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
35 Expression* exp; |
1 | 36 |
37 llvm::Value* mem; | |
38 llvm::Value* val; | |
39 llvm::Value* arg; | |
40 int type; | |
41 bool inplace; | |
42 bool field; | |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
1
diff
changeset
|
43 unsigned callconv; |
15
37a4fdab33fc
[svn r19] * Added support for reassigning 'this' inside class constructors.
lindquist
parents:
11
diff
changeset
|
44 bool isthis; |
52 | 45 bool istypeinfo; |
83
339422268de1
[svn r87] Fixed some memory bloat when passing string literals as char[] params (double temporary before)
lindquist
parents:
52
diff
changeset
|
46 bool temp; |
1 | 47 |
48 VarDeclaration* vardecl; | |
49 FuncDeclaration* funcdecl; | |
50 | |
51 llvm::Value* getValue(); | |
52 //llvm::Value* getMemory(); | |
53 | |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
54 DValue* dvalue; |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
55 |
1 | 56 bool isNull() {return !(mem || val);} |
57 }; | |
58 | |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
59 */ |
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
83
diff
changeset
|
60 |
1 | 61 #endif // LLVMDC_GEN_ELEM_H |