Mercurial > projects > ldc
comparison dmd/mtype.c @ 599:4435f57956e7
Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 15 Sep 2008 02:04:26 +0200 |
parents | e6bcc4d9e5ff |
children | bc83491463f0 |
comparison
equal
deleted
inserted
replaced
598:13ff06605226 | 599:4435f57956e7 |
---|---|
3172 #if LOGDOTEXP | 3172 #if LOGDOTEXP |
3173 printf("TypeDelegate::dotExp(e = '%s', ident = '%s')\n", e->toChars(), ident->toChars()); | 3173 printf("TypeDelegate::dotExp(e = '%s', ident = '%s')\n", e->toChars(), ident->toChars()); |
3174 #endif | 3174 #endif |
3175 if (ident == Id::ptr) | 3175 if (ident == Id::ptr) |
3176 { | 3176 { |
3177 e = new GEPExp(e->loc, e, ident, 0); | |
3177 e->type = tvoidptr; | 3178 e->type = tvoidptr; |
3178 return e; | 3179 return e; |
3179 } | 3180 } |
3180 else if (ident == Id::funcptr) | 3181 else if (ident == Id::funcptr) |
3181 { | 3182 { |
3182 e = e->addressOf(sc); | 3183 e = new GEPExp(e->loc, e, ident, 1); |
3183 e->type = tvoidptr; | 3184 e->type = tvoidptr; |
3184 e = new AddExp(e->loc, e, new IntegerExp(PTRSIZE)); | |
3185 e->type = tvoidptr; | |
3186 e = new PtrExp(e->loc, e); | |
3187 e->type = next->pointerTo(); | |
3188 return e; | 3185 return e; |
3189 } | 3186 } |
3190 else | 3187 else |
3191 { | 3188 { |
3192 e = Type::dotExp(sc, e, ident); | 3189 e = Type::dotExp(sc, e, ident); |