annotate dmd/expression.h @ 1587:def7a1d494fd

Merge DMD 1.051
author Christian Kamm <kamm incasoftware de>
date Fri, 06 Nov 2009 23:58:01 +0100
parents df11cdec45a2
children 207a8a438dea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
2 // Compiler implementation of the D programming language
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
3 // Copyright (c) 1999-2009 by Digital Mars
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
4 // All Rights Reserved
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
5 // written by Walter Bright
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
6 // http://www.digitalmars.com
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
7 // License for redistribution is by either the Artistic License
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
9 // See the included readme.txt for details.
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
10
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
11 #ifndef DMD_EXPRESSION_H
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
12 #define DMD_EXPRESSION_H
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
13
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
14 #include "mars.h"
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
15 #include "identifier.h"
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
16 #include "lexer.h"
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
17 #include "arraytypes.h"
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
18
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
19 struct Type;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
20 struct Scope;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
21 struct TupleDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
22 struct VarDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
23 struct FuncDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
24 struct FuncLiteralDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
25 struct Declaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
26 struct CtorDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
27 struct NewDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
28 struct Dsymbol;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
29 struct Import;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
30 struct Module;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
31 struct ScopeDsymbol;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
32 struct InlineCostState;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
33 struct InlineDoState;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
34 struct InlineScanState;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
35 struct Expression;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
36 struct Declaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
37 struct AggregateDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
38 struct StructDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
39 struct TemplateInstance;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
40 struct TemplateDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
41 struct ClassDeclaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
42 struct HdrGenState;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
43 struct BinExp;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
44 struct InterState;
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
45 struct OverloadSet;
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
46
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
47 enum TOK;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
48
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
49 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
50 // Back end
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
51 struct IRState;
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
52
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
53 struct dt_t;
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
54 struct elem;
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
55 struct Symbol; // back end symbol
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
56 #endif
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
57
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
58 #ifdef IN_GCC
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
59 union tree_node; typedef union tree_node elem;
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
60 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
61
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
62 #if IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
63 struct IRState;
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
64 struct DValue;
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
65 namespace llvm {
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
66 class Constant;
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
67 class ConstantInt;
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
68 }
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
69 #endif
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
70
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
71 void initPrecedence();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
72
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
73 Expression *resolveProperties(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
74 void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
75 Dsymbol *search_function(AggregateDeclaration *ad, Identifier *funcid);
1358
78038e540342 Fix overload resolution issue in dmd bug 313/314 fix.
Christian Kamm <kamm incasoftware de>
parents: 1195
diff changeset
76 void inferApplyArgTypes(enum TOK op, Arguments *arguments, Expression *aggr, Module* from);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
77 void argExpTypesToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
78 void argsToCBuffer(OutBuffer *buf, Expressions *arguments, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
79 void expandTuples(Expressions *exps);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
80 FuncDeclaration *hasThis(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
81 Expression *fromConstInitializer(int result, Expression *e);
1103
b30fe7e1dbb9 - Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 876
diff changeset
82 int arrayExpressionCanThrow(Expressions *exps);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
83
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
84 struct IntRange
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
85 { uinteger_t imin;
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
86 uinteger_t imax;
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
87 };
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
88
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
89 struct Expression : Object
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
90 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
91 Loc loc; // file location
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
92 enum TOK op; // handy to minimize use of dynamic_cast
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
93 Type *type; // !=NULL means that semantic() has been run
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
94 int size; // # of bytes in Expression so we can copy() it
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
95
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
96 Expression(Loc loc, enum TOK op, int size);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
97 Expression *copy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
98 virtual Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
99 virtual Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
100
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
101 int dyncast() { return DYNCAST_EXPRESSION; } // kludge for template.isExpression()
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
102
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
103 void print();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
104 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
105 virtual void dump(int indent);
1372
229e02867307 Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents: 1367
diff changeset
106 void error(const char *format, ...) IS_PRINTF(2);
229e02867307 Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents: 1367
diff changeset
107 void warning(const char *format, ...) IS_PRINTF(2);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
108 virtual void rvalue();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
109
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
110 static Expression *combine(Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
111 static Expressions *arraySyntaxCopy(Expressions *exps);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
112
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
113 virtual dinteger_t toInteger();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
114 virtual uinteger_t toUInteger();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
115 virtual real_t toReal();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
116 virtual real_t toImaginary();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
117 virtual complex_t toComplex();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
118 virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
119 virtual void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
120 virtual Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
121 virtual Expression *modifiableLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
122 Expression *implicitCastTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
123 virtual MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
124 virtual Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
125 virtual void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
126 void checkScalar();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
127 void checkNoBool();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
128 Expression *checkIntegral();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
129 Expression *checkArithmetic();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
130 void checkDeprecated(Scope *sc, Dsymbol *s);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
131 virtual Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
132 Expression *checkToPointer();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
133 Expression *addressOf(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
134 Expression *deref();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
135 Expression *integralPromotions(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
136
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
137 Expression *toDelegate(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
138 virtual void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
139
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
140 virtual Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
141 #define WANTflags 1
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
142 #define WANTvalue 2
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
143 #define WANTinterpret 4
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
144
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
145 virtual Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
146
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
147 virtual int isConst();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
148 virtual int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
149 virtual int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
150 virtual int checkSideEffect(int flag);
336
aaade6ded589 [svn r357] Merged DMD 1.033
lindquist
parents: 159
diff changeset
151 virtual int canThrow();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
152
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
153 virtual int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
154 virtual Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
155 virtual Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
156
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
157 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
158 virtual int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
159 virtual Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
160 virtual Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
161
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
162 // For array ops
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
163 virtual void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
164 virtual Expression *buildArrayLoop(Arguments *fparams);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
165 int isArrayOperand();
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
166
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
167 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
168 // Back end
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
169 virtual elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
170 virtual dt_t **toDt(dt_t **pdt);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
171 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
172
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
173 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
174 virtual DValue* toElem(IRState* irs);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
175 virtual llvm::Constant *toConstElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
176 virtual void cacheLvalue(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
177
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
178 llvm::Value* cachedLvalue;
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
179 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
180 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
181
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
182 struct IntegerExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
183 {
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
184 dinteger_t value;
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
185
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
186 IntegerExp(Loc loc, dinteger_t value, Type *type);
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
187 IntegerExp(dinteger_t value);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
188 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
189 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
190 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
191 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
192 void dump(int indent);
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
193 dinteger_t toInteger();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
194 real_t toReal();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
195 real_t toImaginary();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
196 complex_t toComplex();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
197 int isConst();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
198 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
199 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
200 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
201 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
202 Expression *toLvalue(Scope *sc, Expression *e);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
203 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
204 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
205 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
206 #elif IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
207 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
208 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
209 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
210 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
211
1367
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
212 struct ErrorExp : IntegerExp
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
213 {
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
214 ErrorExp();
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
215
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
216 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
217 };
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
218
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
219 struct RealExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
220 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
221 real_t value;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
222
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
223 RealExp(Loc loc, real_t value, Type *type);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
224 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
225 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
226 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
227 char *toChars();
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
228 dinteger_t toInteger();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
229 uinteger_t toUInteger();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
230 real_t toReal();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
231 real_t toImaginary();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
232 complex_t toComplex();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
233 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
234 int isConst();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
235 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
236 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
237 void toMangleBuffer(OutBuffer *buf);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
238 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
239 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
240 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
241 #elif IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
242 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
243 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
244 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
245 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
246
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
247 struct ComplexExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
248 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
249 complex_t value;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
250
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
251 ComplexExp(Loc loc, complex_t value, Type *type);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
252 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
253 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
254 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
255 char *toChars();
1195
e961851fb8be Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1168
diff changeset
256 dinteger_t toInteger();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
257 uinteger_t toUInteger();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
258 real_t toReal();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
259 real_t toImaginary();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
260 complex_t toComplex();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
261 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
262 int isConst();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
263 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
264 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
265 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
266 #ifdef _DH
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
267 OutBuffer hexp;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
268 #endif
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
269 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
270 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
271 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
272 #elif IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
273 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
274 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
275 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
276 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
277
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
278 struct IdentifierExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
279 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
280 Identifier *ident;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
281 Declaration *var;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
282
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
283 IdentifierExp(Loc loc, Identifier *ident);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
284 IdentifierExp(Loc loc, Declaration *var);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
285 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
286 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
287 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
288 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
289 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
290 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
291
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
292 struct DollarExp : IdentifierExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
293 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
294 DollarExp(Loc loc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
295 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
296
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
297 struct DsymbolExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
298 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
299 Dsymbol *s;
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
300 int hasOverloads;
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
301
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
302 DsymbolExp(Loc loc, Dsymbol *s);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
303 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
304 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
305 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
306 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
307 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
308 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
309
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
310 struct ThisExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
311 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
312 Declaration *var;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
313
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
314 ThisExp(Loc loc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
315 Expression *semantic(Scope *sc);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
316 Expression *interpret(InterState *istate);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
317 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
318 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
319 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
320 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
321
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
322 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
323 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
324 //Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
325
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
326 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
327 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
328 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
329
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
330 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
331 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
332 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
333 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
334
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
335 struct SuperExp : ThisExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
336 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
337 SuperExp(Loc loc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
338 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
339 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
340 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
341
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
342 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
343 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
344 //Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
345 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
346
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
347 struct NullExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
348 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
349 unsigned char committed; // !=0 if type is committed
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
350
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
351 NullExp(Loc loc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
352 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
353 int isBool(int result);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
354 int isConst();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
355 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
356 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
357 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
358 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
359 Expression *interpret(InterState *istate);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
360 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
361 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
362 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
363 #elif IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
364 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
365 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
366 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
367 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
368
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
369 struct StringExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
370 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
371 void *string; // char, wchar, or dchar data
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
372 size_t len; // number of chars, wchars, or dchars
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
373 unsigned char sz; // 1: char, 2: wchar, 4: dchar
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
374 unsigned char committed; // !=0 if type is committed
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
375 unsigned char postfix; // 'c', 'w', 'd'
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
376
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
377 StringExp(Loc loc, char *s);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
378 StringExp(Loc loc, void *s, size_t len);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
379 StringExp(Loc loc, void *s, size_t len, unsigned char postfix);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
380 //Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
381 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
382 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
383 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
384 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
385 StringExp *toUTF8(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
386 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
387 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
388 int compare(Object *obj);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
389 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
390 unsigned charAt(size_t i);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
391 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
392 void toMangleBuffer(OutBuffer *buf);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
393 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
394 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
395 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
396 #elif IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
397 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
398 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
399 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
400 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
401
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
402 // Tuple
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
403
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
404 struct TupleExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
405 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
406 Expressions *exps;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
407
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
408 TupleExp(Loc loc, Expressions *exps);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
409 TupleExp(Loc loc, TupleDeclaration *tup);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
410 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
411 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
412 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
413 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
414 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
415 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
416 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
417 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
418 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
419 Expression *castTo(Scope *sc, Type *t);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
420 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
421 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
422 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
423
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
424 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
425 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
426 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
427
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
428 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
429 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
430 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
431 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
432
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
433 struct ArrayLiteralExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
434 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
435 Expressions *elements;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
436
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
437 ArrayLiteralExp(Loc loc, Expressions *elements);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
438 ArrayLiteralExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
439
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
440 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
441 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
442 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
443 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
444 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
445 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
446 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
447 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
448 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
449 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
450 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
451
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
452 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
453 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
454 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
455
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
456 #if IN_DMD
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
457 elem *toElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
458 dt_t **toDt(dt_t **pdt);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
459 #elif IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
460 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
461 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
462 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
463 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
464
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
465 struct AssocArrayLiteralExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
466 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
467 Expressions *keys;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
468 Expressions *values;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
469
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
470 AssocArrayLiteralExp(Loc loc, Expressions *keys, Expressions *values);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
471
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
472 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
473 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
474 int isBool(int result);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
475 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
476 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
477 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
478 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
479 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
480 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
481 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
482 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
483 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
484 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
485 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
486
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
487 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
488 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
489 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
490
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
491 #if IN_LLVM
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
492 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
493 llvm::Constant *toConstElem(IRState *irs);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
494 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
495 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
496
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
497 struct StructLiteralExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
498 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
499 StructDeclaration *sd; // which aggregate this is for
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
500 Expressions *elements; // parallels sd->fields[] with
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
501 // NULL entries for fields to skip
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
502
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
503 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
504 Symbol *sym; // back end symbol to initialize with literal
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
505 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
506 size_t soffset; // offset from start of s
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
507 int fillHoles; // fill alignment 'holes' with zero
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
508
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
509 StructLiteralExp(Loc loc, StructDeclaration *sd, Expressions *elements);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
510
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
511 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
512 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
513 Expression *getField(Type *type, unsigned offset);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
514 int getFieldIndex(Type *type, unsigned offset);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
515 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
516 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
517 void toMangleBuffer(OutBuffer *buf);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
518 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
519 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
520 Expression *interpret(InterState *istate);
1499
df11cdec45a2 Another shot at fixing the issues with (constant) struct literals and their addresses. See DMD2682, #218, #324.
Christian Kamm <kamm incasoftware de>
parents: 1372
diff changeset
521 Expression *toLvalue(Scope *sc, Expression *e);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
522
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
523 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
524 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
525 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
526
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
527 #if IN_DMD
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
528 elem *toElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
529 dt_t **toDt(dt_t **pdt);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
530 #elif IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
531 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
532 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
533 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
534 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
535
1367
8026319762be Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1358
diff changeset
536 Expression *typeDotIdExp(Loc loc, Type *type, Identifier *ident);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
537 #if IN_DMD
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
538 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
539
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
540 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
541 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
542 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
543
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
544 struct TypeExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
545 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
546 TypeExp(Loc loc, Type *type);
876
27a379f288bf Merged DMD 1.039
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 875
diff changeset
547 Expression *syntaxCopy();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
548 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
549 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
550 Expression *optimize(int result);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
551 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
552 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
553 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
554
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
555 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
556 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
557 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
558 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
559
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
560 struct ScopeExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
561 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
562 ScopeDsymbol *sds;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
563
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
564 ScopeExp(Loc loc, ScopeDsymbol *sds);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
565 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
566 Expression *semantic(Scope *sc);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
567 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
568 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
569 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
570 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
571
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
572 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
573 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
574 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
575 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
576
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
577 struct TemplateExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
578 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
579 TemplateDeclaration *td;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
580
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
581 TemplateExp(Loc loc, TemplateDeclaration *td);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
582 void rvalue();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
583 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
584 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
585
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
586 struct NewExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
587 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
588 /* thisexp.new(newargs) newtype(arguments)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
589 */
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
590 Expression *thisexp; // if !NULL, 'this' for class being allocated
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
591 Expressions *newargs; // Array of Expression's to call new operator
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
592 Type *newtype;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
593 Expressions *arguments; // Array of Expression's
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
594
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
595 CtorDeclaration *member; // constructor function
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
596 NewDeclaration *allocator; // allocator function
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
597 int onstack; // allocate on stack
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
598
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
599 NewExp(Loc loc, Expression *thisexp, Expressions *newargs,
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
600 Type *newtype, Expressions *arguments);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
601 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
602 Expression *semantic(Scope *sc);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
603 Expression *optimize(int result);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
604 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
605 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
606 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
607 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
608 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
609 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
610
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
611 //int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
612 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
613 //Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
614
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
615 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
616 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
617 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
618 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
619
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
620 struct NewAnonClassExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
621 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
622 /* thisexp.new(newargs) class baseclasses { } (arguments)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
623 */
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
624 Expression *thisexp; // if !NULL, 'this' for class being allocated
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
625 Expressions *newargs; // Array of Expression's to call new operator
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
626 ClassDeclaration *cd; // class being instantiated
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
627 Expressions *arguments; // Array of Expression's to call class constructor
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
628
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
629 NewAnonClassExp(Loc loc, Expression *thisexp, Expressions *newargs,
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
630 ClassDeclaration *cd, Expressions *arguments);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
631 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
632 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
633 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
634 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
635 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
636
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
637 // Offset from symbol
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
638
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
639 struct SymOffExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
640 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
641 Declaration *var;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
642 unsigned offset;
1358
78038e540342 Fix overload resolution issue in dmd bug 313/314 fix.
Christian Kamm <kamm incasoftware de>
parents: 1195
diff changeset
643 Module* m; // starting point for overload resolution
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
644
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
645 SymOffExp(Loc loc, Declaration *var, unsigned offset);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
646 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
647 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
648 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
649 int isConst();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
650 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
651 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
652 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
653 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
654 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
655
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
656 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
657 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
658 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
659 #endif
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
660
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
661 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
662 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
663 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
664 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
665
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
666 // Variable
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
667
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
668 struct VarExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
669 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
670 Declaration *var;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
671
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
672 VarExp(Loc loc, Declaration *var);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
673 int equals(Object *o);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
674 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
675 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
676 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
677 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
678 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
679 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
680 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
681 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
682 Expression *modifiableLvalue(Scope *sc, Expression *e);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
683 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
684 elem *toElem(IRState *irs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
685 dt_t **toDt(dt_t **pdt);
1146
1860414bf3b7 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1103
diff changeset
686 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
687 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
688
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
689 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
690 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
691 //Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
692
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
693 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
694 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
695 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
696 void cacheLvalue(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
697 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
698 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
699
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
700 #if DMDV2
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
701 // Overload Set
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
702
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
703 struct OverExp : Expression
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
704 {
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
705 OverloadSet *vars;
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
706
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
707 OverExp(OverloadSet *s);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
708 int isLvalue();
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
709 Expression *toLvalue(Scope *sc, Expression *e);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
710 };
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
711 #endif
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
712
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
713 // Function/Delegate literal
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
714
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
715 struct FuncExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
716 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
717 FuncLiteralDeclaration *fd;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
718
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
719 FuncExp(Loc loc, FuncLiteralDeclaration *fd);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
720 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
721 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
722 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
723 char *toChars();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
724 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
725 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
726 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
727 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
728
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
729 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
730 //Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
731 //Expression *inlineScan(InlineScanState *iss);
797
340acf1535d0 Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 664
diff changeset
732
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
733 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
734 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
735 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
736 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
737 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
738
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
739 // Declaration of a symbol
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
740
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
741 struct DeclarationExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
742 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
743 Dsymbol *declaration;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
744
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
745 DeclarationExp(Loc loc, Dsymbol *declaration);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
746 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
747 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
748 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
749 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
750 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
751 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
752 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
753 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
754 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
755
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
756 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
757 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
758 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
759
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
760 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
761 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
762 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
763 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
764
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
765 struct TypeidExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
766 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
767 Type *typeidType;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
768
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
769 TypeidExp(Loc loc, Type *typeidType);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
770 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
771 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
772 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
773 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
774
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
775 #if DMDV2
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
776 struct TraitsExp : Expression
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
777 {
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
778 Identifier *ident;
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
779 Objects *args;
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
780
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
781 TraitsExp(Loc loc, Identifier *ident, Objects *args);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
782 Expression *syntaxCopy();
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
783 Expression *semantic(Scope *sc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
784 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
785 };
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
786 #endif
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
787
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
788 struct HaltExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
789 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
790 HaltExp(Loc loc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
791 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
792 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
793 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
794
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
795 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
796 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
797 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
798
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
799 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
800 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
801 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
802 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
803
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
804 struct IsExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
805 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
806 /* is(targ id tok tspec)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
807 * is(targ id == tok2)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
808 */
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
809 Type *targ;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
810 Identifier *id; // can be NULL
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
811 enum TOK tok; // ':' or '=='
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
812 Type *tspec; // can be NULL
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
813 enum TOK tok2; // 'struct', 'union', 'typedef', etc.
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
814
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
815 IsExp(Loc loc, Type *targ, Identifier *id, enum TOK tok, Type *tspec, enum TOK tok2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
816 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
817 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
818 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
819 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
820
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
821 /****************************************************************/
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
822
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
823 struct UnaExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
824 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
825 Expression *e1;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
826
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
827 UnaExp(Loc loc, enum TOK op, int size, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
828 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
829 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
830 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
831 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
832 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
833 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
834 Expression *interpretCommon(InterState *istate, Expression *(*fp)(Type *, Expression *));
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
835
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
836 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
837 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
838 Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
839
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
840 Expression *op_overload(Scope *sc); // doesn't need to be virtual
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
841 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
842
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
843 struct BinExp : Expression
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
844 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
845 Expression *e1;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
846 Expression *e2;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
847
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
848 BinExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
849 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
850 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
851 Expression *semanticp(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
852 Expression *commonSemanticAssign(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
853 Expression *commonSemanticAssignIntegral(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
854 int checkSideEffect(int flag);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
855 void checkComplexMulAssign();
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
856 void checkComplexAddAssign();
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
857 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
858 Expression *scaleFactor(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
859 Expression *typeCombine(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
860 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
861 int isunsigned();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
862 void incompatibleTypes();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
863 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
864 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
865 Expression *interpretCommon(InterState *istate, Expression *(*fp)(Type *, Expression *, Expression *));
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
866 Expression *interpretCommon2(InterState *istate, Expression *(*fp)(TOK, Type *, Expression *, Expression *));
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
867 Expression *interpretAssignCommon(InterState *istate, Expression *(*fp)(Type *, Expression *, Expression *), int post = 0);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
868 Expression *arrayOp(Scope *sc);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
869
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
870 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
871 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
872 Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
873
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
874 Expression *op_overload(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
875
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
876 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
877 elem *toElemBin(IRState *irs, int op);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
878 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
879 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
880
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
881 struct BinAssignExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
882 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
883 BinAssignExp(Loc loc, enum TOK op, int size, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
884 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
885 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
886
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
887 /****************************************************************/
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
888
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
889 struct CompileExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
890 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
891 CompileExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
892 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
893 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
894 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
895
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
896 struct FileExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
897 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
898 FileExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
899 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
900 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
901 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
902
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
903 struct AssertExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
904 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
905 Expression *msg;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
906
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
907 AssertExp(Loc loc, Expression *e, Expression *msg = NULL);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
908 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
909 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
910 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
911 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
912 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
913
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
914 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
915 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
916 Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
917
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
918 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
919 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
920 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
921
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
922 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
923 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
924 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
925 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
926
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
927 struct DotIdExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
928 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
929 Identifier *ident;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
930
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
931 DotIdExp(Loc loc, Expression *e, Identifier *ident);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
932 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
933 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
934 void dump(int i);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
935 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
936
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
937 struct DotTemplateExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
938 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
939 TemplateDeclaration *td;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
940
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
941 DotTemplateExp(Loc loc, Expression *e, TemplateDeclaration *td);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
942 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
943 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
944
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
945 struct DotVarExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
946 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
947 Declaration *var;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
948
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
949 DotVarExp(Loc loc, Expression *e, Declaration *var);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
950 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
951 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
952 Expression *modifiableLvalue(Scope *sc, Expression *e);
875
330f999ade44 Merged DMD 1.038
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 860
diff changeset
953 Expression *optimize(int result);
330f999ade44 Merged DMD 1.038
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 860
diff changeset
954 Expression *interpret(InterState *istate);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
955 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
956 void dump(int indent);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
957 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
958 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
959 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
960
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
961 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
962 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
963 void cacheLvalue(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
964 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
965 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
966
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
967 struct DotTemplateInstanceExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
968 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
969 TemplateInstance *ti;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
970
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
971 DotTemplateInstanceExp(Loc loc, Expression *e, TemplateInstance *ti);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
972 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
973 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
974 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
975 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
976 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
977
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
978 struct DelegateExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
979 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
980 FuncDeclaration *func;
1358
78038e540342 Fix overload resolution issue in dmd bug 313/314 fix.
Christian Kamm <kamm incasoftware de>
parents: 1195
diff changeset
981 Module* m; // starting point for overload resolution
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
982
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
983 DelegateExp(Loc loc, Expression *e, FuncDeclaration *func);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
984 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
985 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
986 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
987 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
988 void dump(int indent);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
989
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
990 int inlineCost(InlineCostState *ics);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
991 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
992 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
993 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
994
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
995 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
996 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
997 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
998 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
999
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1000 struct DotTypeExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1001 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1002 Dsymbol *sym; // symbol that represents a type
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1003
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1004 DotTypeExp(Loc loc, Expression *e, Dsymbol *sym);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1005 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1006 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1007 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1008 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1009 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1010
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1011 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1012 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1013 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1014 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1015
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1016 struct CallExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1017 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1018 Expressions *arguments; // function arguments
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1019
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1020 CallExp(Loc loc, Expression *e, Expressions *exps);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1021 CallExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1022 CallExp(Loc loc, Expression *e, Expression *earg1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1023 CallExp(Loc loc, Expression *e, Expression *earg1, Expression *earg2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1024
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1025 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1026 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1027 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1028 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1029 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1030 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1031 void dump(int indent);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1032 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1033 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1034 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1035 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1036 Expression *toLvalue(Scope *sc, Expression *e);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
1037 Expression *modifiableLvalue(Scope *sc, Expression *e);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1038
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1039 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1040 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1041 Expression *inlineScan(InlineScanState *iss);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1042
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1043 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1044 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1045 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1046 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1047
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1048 struct AddrExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1049 {
1358
78038e540342 Fix overload resolution issue in dmd bug 313/314 fix.
Christian Kamm <kamm incasoftware de>
parents: 1195
diff changeset
1050 Module* m; // starting point for overload resolution
78038e540342 Fix overload resolution issue in dmd bug 313/314 fix.
Christian Kamm <kamm incasoftware de>
parents: 1195
diff changeset
1051
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1052 AddrExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1053 Expression *semantic(Scope *sc);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1054 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1055 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1056 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1057 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1058 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1059 Expression *optimize(int result);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1060
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1061 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1062 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1063 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1064 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1065 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1066
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1067 struct PtrExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1068 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1069 PtrExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1070 PtrExp(Loc loc, Expression *e, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1071 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1072 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1073 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1074 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1075 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1076 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1077 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1078 Expression *interpret(InterState *istate);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1079
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1080 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1081 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1082 void cacheLvalue(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1083 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1084 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1085
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1086 struct NegExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1087 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1088 NegExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1089 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1090 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1091 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1092 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1093 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1094
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1095 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1096 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1097
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1098 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1099 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1100 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1101
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1102 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1103 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1104 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1105 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1106
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1107 struct UAddExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1108 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1109 UAddExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1110 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1111
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1112 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1113 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1114 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1115
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1116 struct ComExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1117 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1118 ComExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1119 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1120 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1121 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1122 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1123 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1124
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1125 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1126 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1127
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1128 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1129 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1130 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1131
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1132 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1133 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1134 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1135 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1136
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1137 struct NotExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1138 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1139 NotExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1140 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1141 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1142 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1143 int isBit();
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1144 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1145 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1146 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1147
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1148 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1149 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1150 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1151 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1152
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1153 struct BoolExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1154 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1155 BoolExp(Loc loc, Expression *e, Type *type);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1156 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1157 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1158 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1159 int isBit();
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1160 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1161 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1162 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1163
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1164 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1165 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1166 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1167 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1168
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1169 struct DeleteExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1170 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1171 DeleteExp(Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1172 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1173 Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1174 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1175 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1176 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1177 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1178 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1179
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1180 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1181 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1182 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1183 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1184
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1185 struct CastExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1186 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1187 // Possible to cast to one type while painting to another type
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1188 Type *to; // type to cast to
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1189
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1190 CastExp(Loc loc, Expression *e, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1191 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1192 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1193 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1194 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1195 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1196 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1197 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1587
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
1198 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
def7a1d494fd Merge DMD 1.051
Christian Kamm <kamm incasoftware de>
parents: 1499
diff changeset
1199 Expression *buildArrayLoop(Arguments *fparams);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1200 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1201 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1202 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1203
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1204 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1205 Identifier *opId();
619
722630261d62 Implemented constant pointer casts (like casting function pointer to void* as a constant global initializer)
tomas@myhost
parents: 599
diff changeset
1206
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1207 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1208 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1209 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1210 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1211 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1212
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1213
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1214 struct SliceExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1215 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1216 Expression *upr; // NULL if implicit 0
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1217 Expression *lwr; // NULL if implicit [length - 1]
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1218 VarDeclaration *lengthVar;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1219
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1220 SliceExp(Loc loc, Expression *e1, Expression *lwr, Expression *upr);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1221 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1222 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1223 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1224 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1225 Expression *modifiableLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1226 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1227 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1228 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1229 void dump(int indent);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1230 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1231 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1232 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1233 void scanForNestedRef(Scope *sc);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1234 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1235 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1236
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1237 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1238 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1239 Expression *inlineScan(InlineScanState *iss);
860
7edce7e58ab1 Add more toConstElem stubs to get better error messages.
Christian Kamm <kamm incasoftware de>
parents: 797
diff changeset
1240
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1241 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1242 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1243 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1244 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1245 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1246
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1247 struct ArrayLengthExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1248 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1249 ArrayLengthExp(Loc loc, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1250 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1251 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1252 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1253 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1254 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1255 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1256 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1257
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1258 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1259 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1260 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1261 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1262
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1263 // e1[a0,a1,a2,a3,...]
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1264
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1265 struct ArrayExp : UnaExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1266 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1267 Expressions *arguments; // Array of Expression's
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1268
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1269 ArrayExp(Loc loc, Expression *e1, Expressions *arguments);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1270 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1271 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1272 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1273 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1274 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1275
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1276 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1277 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1278
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1279 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1280 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1281 Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1282 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1283
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1284 /****************************************************************/
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1285
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1286 struct DotExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1287 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1288 DotExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1289 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1290 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1291
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1292 struct CommaExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1293 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1294 CommaExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1295 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1296 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1297 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1298 Expression *modifiableLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1299 int isBool(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1300 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1301 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1302 Expression *interpret(InterState *istate);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1303 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1304 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1305 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1306
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1307 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1308 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1309 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1310 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1311
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1312 struct IndexExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1313 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1314 VarDeclaration *lengthVar;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1315 int modifiable;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1316
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1317 IndexExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1318 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1319 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1320 Expression *modifiableLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1321 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1322 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1323 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1324 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1325 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1326
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1327 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1328 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1329 #elif IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1330 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1331 llvm::Constant *toConstElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1332 void cacheLvalue(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1333 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1334 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1335
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1336 /* For both i++ and i--
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1337 */
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1338 struct PostExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1339 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1340 PostExp(enum TOK op, Loc loc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1341 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1342 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1343 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1344 Identifier *opId(); // For operator overloading
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1345 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1346 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1347 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1348
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1349 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1350 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1351 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1352 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1353
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1354 struct AssignExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1355 { int ismemset; // !=0 if setting the contents of an array
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1356
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1357 AssignExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1358 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1359 Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1360 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1361 Identifier *opId(); // For operator overloading
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1362 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1363 Expression *buildArrayLoop(Arguments *fparams);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1364 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1365 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1366 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1367
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1368 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1369 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1370 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1371 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1372
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1373 #if IN_DMD
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1374 #define ASSIGNEXP_TOELEM elem *toElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1375 #elif IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1376 #define ASSIGNEXP_TOELEM DValue* toElem(IRState *irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1377 #else
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1378 #define ASSIGNEXP_TOELEM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1379 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1380
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1381 #define ASSIGNEXP(op) \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1382 struct op##AssignExp : BinExp \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1383 { \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1384 op##AssignExp(Loc loc, Expression *e1, Expression *e2); \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1385 Expression *semantic(Scope *sc); \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1386 Expression *interpret(InterState *istate); \
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1387 X(void buildArrayIdent(OutBuffer *buf, Expressions *arguments);) \
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1388 X(Expression *buildArrayLoop(Arguments *fparams);) \
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1389 \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1390 Identifier *opId(); /* For operator overloading */ \
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1391 \
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1392 ASSIGNEXP_TOELEM \
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1393 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1394
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1395 #define X(a) a
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1396 ASSIGNEXP(Add)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1397 ASSIGNEXP(Min)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1398 ASSIGNEXP(Mul)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1399 ASSIGNEXP(Div)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1400 ASSIGNEXP(Mod)
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1401 ASSIGNEXP(And)
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1402 ASSIGNEXP(Or)
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1403 ASSIGNEXP(Xor)
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1404 #undef X
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1405
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1406 #define X(a)
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1407
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1408 ASSIGNEXP(Shl)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1409 ASSIGNEXP(Shr)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1410 ASSIGNEXP(Ushr)
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1411 ASSIGNEXP(Cat)
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1412
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1413 #undef X
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1414 #undef ASSIGNEXP
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1415 #undef ASSIGNEXP_TOELEM
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1416
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1417 struct AddExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1418 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1419 AddExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1420 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1421 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1422 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1423 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1424 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1425
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1426 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1427 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1428 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1429 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1430
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1431 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1432 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1433 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1434
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1435 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1436 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1437 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1438 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1439
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1440 struct MinExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1441 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1442 MinExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1443 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1444 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1445 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1446 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1447 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1448
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1449 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1450 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1451 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1452
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1453 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1454 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1455 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1456
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1457 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1458 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1459 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1460 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1461
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1462 struct CatExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1463 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1464 CatExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1465 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1466 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1467 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1468
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1469 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1470 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1471 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1472
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1473 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1474 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1475 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1476
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1477 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1478 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1479 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1480 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1481
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1482 struct MulExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1483 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1484 MulExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1485 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1486 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1487 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1488 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1489 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1490
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1491 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1492 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1493 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1494 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1495
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1496 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1497 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1498 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1499
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1500 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1501 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1502 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1503 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1504
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1505 struct DivExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1506 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1507 DivExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1508 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1509 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1510 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1511 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1512 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1513
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1514 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1515 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1516 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1517
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1518 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1519 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1520 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1521
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1522 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1523 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1524 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1525 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1526
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1527 struct ModExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1528 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1529 ModExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1530 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1531 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1532 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1533 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1534 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1535
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1536 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1537 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1538 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1539
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1540 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1541 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1542 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1543
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1544 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1545 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1546 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1547 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1548
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1549 struct ShlExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1550 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1551 ShlExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1552 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1553 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1554 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1555
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1556 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1557 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1558 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1559
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1560 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1561 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1562 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1563
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1564 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1565 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1566 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1567 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1568
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1569 struct ShrExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1570 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1571 ShrExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1572 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1573 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1574 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1575
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1576 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1577 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1578 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1579
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1580 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1581 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1582 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1583
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1584 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1585 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1586 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1587 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1588
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1589 struct UshrExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1590 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1591 UshrExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1592 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1593 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1594 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1595
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1596 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1597 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1598 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1599
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1600 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1601 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1602 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1603
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1604 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1605 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1606 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1607 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1608
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1609 struct AndExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1610 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1611 AndExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1612 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1613 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1614 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1615 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1616 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1617
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1618 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1619 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1620 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1621 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1622
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1623 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1624 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1625 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1626
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1627 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1628 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1629 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1630 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1631
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1632 struct OrExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1633 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1634 OrExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1635 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1636 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1637 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1638 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1639 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1640
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1641 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1642 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1643 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1644 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1645
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1646 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1647 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1648 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1649
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1650 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1651 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1652 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1653 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1654
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1655 struct XorExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1656 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1657 XorExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1658 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1659 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1660 Expression *interpret(InterState *istate);
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1661 void buildArrayIdent(OutBuffer *buf, Expressions *arguments);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1662 Expression *buildArrayLoop(Arguments *fparams);
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1663
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1664 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1665 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1666 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1667 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1668
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1669 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1670 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1671 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1672
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1673 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1674 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1675 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1676 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1677
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1678 struct OrOrExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1679 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1680 OrOrExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1681 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1682 Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1683 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1684 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1685 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1686 int checkSideEffect(int flag);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1687 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1688 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1689 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1690
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1691 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1692 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1693 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1694 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1695
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1696 struct AndAndExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1697 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1698 AndAndExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1699 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1700 Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1701 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1702 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1703 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1704 int checkSideEffect(int flag);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1705 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1706 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1707 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1708
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1709 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1710 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1711 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1712 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1713
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1714 struct CmpExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1715 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1716 CmpExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1717 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1718 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1719 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1720 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1721
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1722 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1723 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1724 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1725
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1726 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1727 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1728 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1729
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1730 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1731 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1732 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1733 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1734
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1735 struct InExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1736 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1737 InExp(Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1738 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1739 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1740
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1741 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1742 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1743 Identifier *opId_r();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1744
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1745 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1746 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1747 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1748
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1749 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1750 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1751 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1752 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1753
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1754 struct RemoveExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1755 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1756 RemoveExp(Loc loc, Expression *e1, Expression *e2);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1757 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1758 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1759 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1760
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1761 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1762 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1763 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1764 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1765
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1766 // == and !=
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1767
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1768 struct EqualExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1769 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1770 EqualExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1771 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1772 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1773 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1774 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1775
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1776 // For operator overloading
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1777 int isCommutative();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1778 Identifier *opId();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1779
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1780 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1781 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1782 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1783
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1784 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1785 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1786 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1787 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1788
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1789 // === and !===
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1790
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1791 struct IdentityExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1792 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1793 IdentityExp(enum TOK op, Loc loc, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1794 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1795 int isBit();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1796 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1797 Expression *interpret(InterState *istate);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1798 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1799 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1800 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1801
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1802 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1803 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1804 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1805 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1806
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1807 /****************************************************************/
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1808
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1809 struct CondExp : BinExp
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1810 {
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1811 Expression *econd;
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1812
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1813 CondExp(Loc loc, Expression *econd, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1814 Expression *syntaxCopy();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1815 Expression *semantic(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1816 Expression *optimize(int result);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1817 Expression *interpret(InterState *istate);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1818 void checkEscape();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1819 Expression *toLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1820 Expression *modifiableLvalue(Scope *sc, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1821 Expression *checkToBoolean();
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1822 int checkSideEffect(int flag);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1823 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1824 MATCH implicitConvTo(Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1825 Expression *castTo(Scope *sc, Type *t);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1826 void scanForNestedRef(Scope *sc);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1827
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1828 int inlineCost(InlineCostState *ics);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1829 Expression *doInline(InlineDoState *ids);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1830 Expression *inlineScan(InlineScanState *iss);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1831
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1832 #if IN_DMD
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1833 elem *toElem(IRState *irs);
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1834 #endif
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1835
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1836 #if IN_LLVM
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1837 DValue* toElem(IRState* irs);
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1838 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1839 };
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1840
510
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1841 #if DMDV2
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1842 /****************************************************************/
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1843
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1844 struct DefaultInitExp : Expression
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1845 {
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1846 enum TOK subop; // which of the derived classes this is
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1847
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1848 DefaultInitExp(Loc loc, enum TOK subop, int size);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1849 virtual Expression *resolve(Loc loc, Scope *sc) = 0;
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1850 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1851 };
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1852
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1853 struct FileInitExp : DefaultInitExp
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1854 {
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1855 FileInitExp(Loc loc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1856 Expression *semantic(Scope *sc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1857 Expression *resolve(Loc loc, Scope *sc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1858 };
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1859
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1860 struct LineInitExp : DefaultInitExp
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1861 {
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1862 LineInitExp(Loc loc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1863 Expression *semantic(Scope *sc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1864 Expression *resolve(Loc loc, Scope *sc);
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1865 };
6aee82889553 Merged DMD 1.034, array operations are not yet implemented ;)
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 459
diff changeset
1866 #endif
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1867
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1868 /****************************************************************/
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1869
599
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1870 #if IN_LLVM
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1871
664
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 619
diff changeset
1872 // this stuff is strictly LDC
599
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1873
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1874 struct GEPExp : UnaExp
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1875 {
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1876 unsigned index;
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1877 Identifier* ident;
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1878
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1879 GEPExp(Loc loc, Expression* e, Identifier* id, unsigned idx);
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1880 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1881 Expression *toLvalue(Scope *sc, Expression *e);
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1882
1151
3cf0066e6faf - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents: 1146
diff changeset
1883 DValue* toElem(IRState* irs);
860
7edce7e58ab1 Add more toConstElem stubs to get better error messages.
Christian Kamm <kamm incasoftware de>
parents: 797
diff changeset
1884 llvm::Constant *toConstElem(IRState *irs);
599
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1885 };
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1886
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1887 #endif
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1888
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1889 /****************************************************************/
4435f57956e7 Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 588
diff changeset
1890
159
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1891 /* Special values used by the interpreter
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1892 */
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1893 #define EXP_CANT_INTERPRET ((Expression *)1)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1894 #define EXP_CONTINUE_INTERPRET ((Expression *)2)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1895 #define EXP_BREAK_INTERPRET ((Expression *)3)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1896 #define EXP_GOTO_INTERPRET ((Expression *)4)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1897 #define EXP_VOID_INTERPRET ((Expression *)5)
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1898
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1899 Expression *expType(Type *type, Expression *e);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1900
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1901 Expression *Neg(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1902 Expression *Com(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1903 Expression *Not(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1904 Expression *Bool(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1905 Expression *Cast(Type *type, Type *to, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1906 Expression *ArrayLength(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1907 Expression *Ptr(Type *type, Expression *e1);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1908
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1909 Expression *Add(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1910 Expression *Min(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1911 Expression *Mul(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1912 Expression *Div(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1913 Expression *Mod(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1914 Expression *Shl(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1915 Expression *Shr(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1916 Expression *Ushr(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1917 Expression *And(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1918 Expression *Or(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1919 Expression *Xor(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1920 Expression *Index(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1921 Expression *Cat(Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1922
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1923 Expression *Equal(enum TOK op, Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1924 Expression *Cmp(enum TOK op, Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1925 Expression *Identity(enum TOK op, Type *type, Expression *e1, Expression *e2);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1926
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1927 Expression *Slice(Type *type, Expression *e1, Expression *lwr, Expression *upr);
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1928
5acec6b2eef8 [svn r175] merged dmd 1.029
ChristianK
parents: 108
diff changeset
1929 #endif /* DMD_EXPRESSION_H */