Mercurial > projects > ldc
diff gen/llvmhelpers.cpp @ 758:f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 11 Nov 2008 01:38:48 +0100 |
parents | 2c730d530c98 |
children | 5696a7167b21 |
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp Mon Nov 10 20:55:24 2008 +0100 +++ b/gen/llvmhelpers.cpp Tue Nov 11 01:38:48 2008 +0100 @@ -410,7 +410,7 @@ if (DSliceValue* s2 = rhs->isSlice()) { DtoArrayCopySlices(s, s2); } - else if (t->next->toBasetype()->equals(t2)) { + else if (t->nextOf()->toBasetype()->equals(t2)) { DtoArrayInit(loc, s, rhs); } else { @@ -441,11 +441,11 @@ DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal()); } // T[n] = T - else if (t->next->toBasetype()->equals(t2)) { + else if (t->nextOf()->toBasetype()->equals(t2)) { DtoArrayInit(loc, lhs, rhs); } // T[n] = T[] - generally only generated by frontend in rare cases - else if (t2->ty == Tarray && t->next->toBasetype()->equals(t2->next->toBasetype())) { + else if (t2->ty == Tarray && t->nextOf()->toBasetype()->equals(t2->nextOf()->toBasetype())) { DtoMemCpy(lhs->getLVal(), DtoArrayPtr(rhs), DtoArrayLen(rhs)); } else { assert(0 && "Unimplemented static array assign!"); @@ -531,7 +531,7 @@ else if (basety == Tarray) { LLValue* len = DtoConstSize_t(0); - LLValue* ptr = getNullPtr(getPtrToType(DtoType(basetype->next))); + LLValue* ptr = getNullPtr(getPtrToType(DtoType(basetype->nextOf()))); return new DSliceValue(type, len, ptr); } // delegate @@ -743,7 +743,7 @@ { Type* at = to->toBasetype(); assert(at->ty == Tarray); - Type* elem = at->next->pointerTo(); + Type* elem = at->nextOf()->pointerTo(); if (DSliceValue* slice = val->isSlice()) { return new DSliceValue(to, slice->len, DtoBitCast(slice->ptr, DtoType(elem))); @@ -1188,7 +1188,11 @@ Logger::println("vdtype = %s", vd->type->toChars()); // referenced by nested delegate? + #if DMDV2 + if (vd->nestedrefs.dim) { + #else if (vd->nestedref) { + #endif Logger::println("has nestedref set"); assert(vd->ir.irLocal); @@ -1330,7 +1334,11 @@ assert(!var->aliassym); // referenced by nested function? +#if DMDV2 + if (var->nestedrefs.dim) +#else if (var->nestedref) +#endif { assert(var->ir.irLocal); assert(!var->ir.irLocal->value); @@ -1519,8 +1527,8 @@ assert(t->ty == Tsarray); TypeSArray* tsa = (TypeSArray*)t; dims.push_back(tsa->dim->toInteger()); - assert(t->next); - t = t->next->toBasetype(); + assert(t->nextOf()); + t = t->nextOf()->toBasetype(); } size_t i = dims.size();