[svn r136] MAJOR UNSTABLE UPDATE!!!

Initial commit after moving to Tango instead of Phobos.

Lots of bugfixes...

This build is not suitable for most things.
This commit is contained in:
Tomas Lindquist Olsen
2008-01-11 17:57:40 +01:00
parent bc08c6fcb1
commit b15b3484c8
524 changed files with 270705 additions and 175 deletions
+28
View File
@@ -597,6 +597,34 @@ void DtoCatArrays(llvm::Value* arr, Expression* exp1, Expression* exp2)
DtoMemCpy(mem,src2,len2);
}
//////////////////////////////////////////////////////////////////////////////////////////
void DtoCatArrayElement(llvm::Value* arr, Expression* exp1, Expression* exp2)
{
Type* t1 = DtoDType(exp1->type);
Type* t2 = DtoDType(exp2->type);
assert(t1->ty == Tarray);
assert(t2 == DtoDType(t1->next));
DValue* e1 = exp1->toElem(gIR);
DValue* e2 = exp2->toElem(gIR);
llvm::Value *len1, *src1, *res;
llvm::Value* a = e1->getRVal();
len1 = gIR->ir->CreateLoad(DtoGEPi(a,0,0,"tmp"),"tmp");
res = gIR->ir->CreateAdd(len1,DtoConstSize_t(1),"tmp");
llvm::Value* mem = DtoNewDynArray(arr, res, DtoDType(t1->next), false);
src1 = gIR->ir->CreateLoad(DtoGEPi(a,0,1,"tmp"),"tmp");
DtoMemCpy(mem,src1,len1);
mem = gIR->ir->CreateGEP(mem,len1,"tmp");
DVarValue* memval = new DVarValue(e2->getType(), mem, true);
DtoAssign(memval, e2);
}
//////////////////////////////////////////////////////////////////////////////////////////
// helper for eq and cmp
static llvm::Value* DtoArrayEqCmp_impl(const char* func, DValue* l, DValue* r, bool useti)