Mercurial > projects > ldc
comparison dmd/expression.c @ 486:a34078905d01
Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Reimplemented support for nested functions/class using a new approach.
Added error on taking address of intrinsic.
Fixed problems with the ->syntaxCopy of TypeFunction delegate exp.
Removed DtoDType and replaced all uses with ->toBasetype() instead.
Removed unused inplace stuff.
Fixed a bunch of issues in the runtime unittests, not complete yet.
Added mini tests.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sun, 10 Aug 2008 08:37:38 +0200 |
parents | e19e20103119 |
children | 6aee82889553 |
comparison
equal
deleted
inserted
replaced
485:50f6e2337a6b | 486:a34078905d01 |
---|---|
258 { FuncDeclaration *f = s->isFuncDeclaration(); | 258 { FuncDeclaration *f = s->isFuncDeclaration(); |
259 if (f->vthis) | 259 if (f->vthis) |
260 { | 260 { |
261 //printf("rewriting e1 to %s's this\n", f->toChars()); | 261 //printf("rewriting e1 to %s's this\n", f->toChars()); |
262 n++; | 262 n++; |
263 | |
264 // LLVMDC seems dmd misses it sometimes here :/ | |
265 f->vthis->nestedref = 1; | |
266 | |
263 e1 = new VarExp(loc, f->vthis); | 267 e1 = new VarExp(loc, f->vthis); |
264 } | 268 } |
265 } | 269 } |
266 if (s && s->isClassDeclaration()) | 270 if (s && s->isClassDeclaration()) |
267 { e1->type = s->isClassDeclaration()->type; | 271 { e1->type = s->isClassDeclaration()->type; |
5981 { | 5985 { |
5982 VarExp *dve = (VarExp *)e1; | 5986 VarExp *dve = (VarExp *)e1; |
5983 FuncDeclaration *f = dve->var->isFuncDeclaration(); | 5987 FuncDeclaration *f = dve->var->isFuncDeclaration(); |
5984 VarDeclaration *v = dve->var->isVarDeclaration(); | 5988 VarDeclaration *v = dve->var->isVarDeclaration(); |
5985 | 5989 |
5990 // LLVMDC | |
5991 if (f && f->isIntrinsic()) | |
5992 { | |
5993 error("cannot take the address of intrinsic function %s", e1->toChars()); | |
5994 return this; | |
5995 } | |
5996 | |
5986 if (f && f->isNested()) | 5997 if (f && f->isNested()) |
5987 { Expression *e; | 5998 { Expression *e; |
5988 | 5999 |
5989 e = new DelegateExp(loc, e1, f); | 6000 e = new DelegateExp(loc, e1, f); |
5990 e = e->semantic(sc); | 6001 e = e->semantic(sc); |