annotate dmd/expression.h @ 1626:8fa4ab3dcc88

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