From f3bf9fd277274463f22105859d14c69994d5430a Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Wed, 11 May 2011 21:13:43 +0400 Subject: [PATCH] Improve _d_arrayappendT call --- gen/arrays.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gen/arrays.cpp b/gen/arrays.cpp index c27f09bb..ed75177e 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -780,7 +780,6 @@ DSliceValue* DtoCatAssignArray(DValue* arr, Expression* exp) Logger::println("DtoCatAssignArray"); LOG_SCOPE; Type *arrayType = arr->getType(); - DValue* valueToAppend = exp->toElem(gIR); // Prepare arguments LLFunction* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_arrayappendT"); @@ -790,9 +789,9 @@ DSliceValue* DtoCatAssignArray(DValue* arr, Expression* exp) // byte[] *px args.push_back(DtoBitCast(arr->getLVal(), fn->getFunctionType()->getParamType(1))); // byte[] y - LLValue *y = makeLValue(exp->loc, valueToAppend); - y = DtoBitCast(y, getPtrToType(fn->getFunctionType()->getParamType(2))); - args.push_back(DtoLoad(y)); + LLValue *y = DtoSlice(exp->toElem(gIR)); + y = DtoAggrPaint(y, fn->getFunctionType()->getParamType(2)); + args.push_back(y); // Call _d_arrayappendT LLValue* newArray = gIR->CreateCallOrInvoke(fn, args.begin(), args.end(), ".appendedArray").getInstruction();