Mercurial > projects > ldc
comparison dmd2/clone.c @ 847:356e65836fb5
Merged DMD 2.021 frontend.
Removed generated files from dmd/dmd2 dirs.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sat, 13 Dec 2008 16:14:37 +0100 |
parents | f04dde6e882c |
children | 638d16625da2 |
comparison
equal
deleted
inserted
replaced
846:bc982f1ad106 | 847:356e65836fb5 |
---|---|
85 | 85 |
86 Argument *param = new Argument(STCnodtor, type, Id::p, NULL); | 86 Argument *param = new Argument(STCnodtor, type, Id::p, NULL); |
87 Arguments *fparams = new Arguments; | 87 Arguments *fparams = new Arguments; |
88 fparams->push(param); | 88 fparams->push(param); |
89 Type *ftype = new TypeFunction(fparams, handle, FALSE, LINKd); | 89 Type *ftype = new TypeFunction(fparams, handle, FALSE, LINKd); |
90 #if STRUCTTHISREF | |
91 ((TypeFunction *)ftype)->isref = 1; | |
92 #endif | |
90 | 93 |
91 fop = new FuncDeclaration(0, 0, Id::assign, STCundefined, ftype); | 94 fop = new FuncDeclaration(0, 0, Id::assign, STCundefined, ftype); |
92 | 95 |
93 Expression *e = NULL; | 96 Expression *e = NULL; |
94 if (postblit) | 97 if (postblit) |
104 tmp = new VarDeclaration(0, type, idtmp, new VoidInitializer(0)); | 107 tmp = new VarDeclaration(0, type, idtmp, new VoidInitializer(0)); |
105 tmp->noauto = 1; | 108 tmp->noauto = 1; |
106 e = new DeclarationExp(0, tmp); | 109 e = new DeclarationExp(0, tmp); |
107 ec = new AssignExp(0, | 110 ec = new AssignExp(0, |
108 new VarExp(0, tmp), | 111 new VarExp(0, tmp), |
109 new PtrExp(0, new ThisExp(0))); | 112 #if STRUCTTHISREF |
113 new ThisExp(0) | |
114 #else | |
115 new PtrExp(0, new ThisExp(0)) | |
116 #endif | |
117 ); | |
110 ec->op = TOKblit; | 118 ec->op = TOKblit; |
111 e = Expression::combine(e, ec); | 119 e = Expression::combine(e, ec); |
112 } | 120 } |
113 ec = new AssignExp(0, | 121 ec = new AssignExp(0, |
122 #if STRUCTTHISREF | |
123 new ThisExp(0), | |
124 #else | |
114 new PtrExp(0, new ThisExp(0)), | 125 new PtrExp(0, new ThisExp(0)), |
126 #endif | |
115 new IdentifierExp(0, Id::p)); | 127 new IdentifierExp(0, Id::p)); |
116 ec->op = TOKblit; | 128 ec->op = TOKblit; |
117 e = Expression::combine(e, ec); | 129 e = Expression::combine(e, ec); |
118 if (dtor) | 130 if (dtor) |
119 { | 131 { |
203 | 215 |
204 fcp = new FuncDeclaration(0, 0, Id::cpctor, STCundefined, ftype); | 216 fcp = new FuncDeclaration(0, 0, Id::cpctor, STCundefined, ftype); |
205 | 217 |
206 // Build *this = p; | 218 // Build *this = p; |
207 Expression *e = new ThisExp(0); | 219 Expression *e = new ThisExp(0); |
220 #if !STRUCTTHISREF | |
208 e = new PtrExp(0, e); | 221 e = new PtrExp(0, e); |
222 #endif | |
209 AssignExp *ea = new AssignExp(0, e, new IdentifierExp(0, Id::p)); | 223 AssignExp *ea = new AssignExp(0, e, new IdentifierExp(0, Id::p)); |
210 ea->op = TOKblit; | 224 ea->op = TOKblit; |
211 Statement *s = new ExpStatement(0, ea); | 225 Statement *s = new ExpStatement(0, ea); |
212 | 226 |
213 // Build postBlit(); | 227 // Build postBlit(); |