static void storeVariable(VarDeclaration *vd, LLValue *dst) { LLValue *value = vd->ir.irLocal->value; int ty = vd->type->ty; FuncDeclaration *fd = getParentFunc(vd, true); assert(fd && "No parent function for nested variable?"); if (fd->needsClosure() && !vd->isRef() && (ty == Tstruct || ty == Tsarray) && isaPointer(value->getType())) { // Copy structs and static arrays LLValue *mem = DtoGcMalloc(vd->loc, DtoType(vd->type), ".gc_mem"); DtoAggrCopy(mem, value); DtoAlignedStore(mem, dst); } else // Store the address into the frame DtoAlignedStore(value, dst); }
void getL(Type *dty, LLValue *v, LLValue *lval) override { DtoAggrCopy(lval, v); }
void getL(Type* dty, DValue* v, LLValue* lval) { LLValue* pointer = v->getRVal(); DtoAggrCopy(lval, pointer); }