comparison gen/toir.cpp @ 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 e096a1502428
children 311f16f26297
comparison
equal deleted inserted replaced
598:13ff06605226 599:4435f57956e7
2378 return aa; 2378 return aa;
2379 } 2379 }
2380 2380
2381 ////////////////////////////////////////////////////////////////////////////////////////// 2381 //////////////////////////////////////////////////////////////////////////////////////////
2382 2382
2383 DValue* GEPExp::toElem(IRState* p)
2384 {
2385 // this should be good enough for now!
2386 DValue* val = e1->toElem(p);
2387 assert(val->isLVal());
2388 LLValue* v = DtoGEPi(val->getLVal(), 0, index);
2389 return new DVarValue(type, DtoBitCast(v, getPtrToType(DtoType(type))));
2390 }
2391
2392 //////////////////////////////////////////////////////////////////////////////////////////
2393
2383 #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; } 2394 #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; }
2384 STUB(Expression); 2395 STUB(Expression);
2385 STUB(DotTypeExp); 2396 STUB(DotTypeExp);
2386 STUB(TypeDotIdExp); 2397 STUB(TypeDotIdExp);
2387 STUB(ScopeExp); 2398 STUB(ScopeExp);