mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
[svn r190] Fixed array concatenation for some broken cases.
Added a sanity check for the Dsymbol state set.
This commit is contained in:
@@ -578,20 +578,18 @@ void DtoCatArrays(llvm::Value* arr, Expression* exp1, Expression* exp2)
|
||||
assert(t1->ty == t2->ty);
|
||||
|
||||
DValue* e1 = exp1->toElem(gIR);
|
||||
llvm::Value* a = e1->getRVal();
|
||||
|
||||
DValue* e2 = exp2->toElem(gIR);
|
||||
llvm::Value* b = e2->getRVal();
|
||||
|
||||
llvm::Value *len1, *len2, *src1, *src2, *res;
|
||||
len1 = gIR->ir->CreateLoad(DtoGEPi(a,0,0,"tmp"),"tmp");
|
||||
len2 = gIR->ir->CreateLoad(DtoGEPi(b,0,0,"tmp"),"tmp");
|
||||
|
||||
len1 = DtoArrayLen(e1);
|
||||
len2 = DtoArrayLen(e2);
|
||||
res = gIR->ir->CreateAdd(len1,len2,"tmp");
|
||||
|
||||
llvm::Value* mem = DtoNewDynArray(arr, res, DtoDType(t1->next), false);
|
||||
|
||||
src1 = gIR->ir->CreateLoad(DtoGEPi(a,0,1,"tmp"),"tmp");
|
||||
src2 = gIR->ir->CreateLoad(DtoGEPi(b,0,1,"tmp"),"tmp");
|
||||
src1 = DtoArrayPtr(e1);
|
||||
src2 = DtoArrayPtr(e2);
|
||||
|
||||
DtoMemCpy(mem,src1,len1);
|
||||
mem = gIR->ir->CreateGEP(mem,len1,"tmp");
|
||||
|
||||
@@ -14,13 +14,13 @@ void IrDsymbol::resetAll()
|
||||
|
||||
IrDsymbol::IrDsymbol()
|
||||
{
|
||||
list.insert(this);
|
||||
assert(list.insert(this).second);
|
||||
reset();
|
||||
}
|
||||
|
||||
IrDsymbol::IrDsymbol(const IrDsymbol& s)
|
||||
{
|
||||
list.insert(this);
|
||||
assert(list.insert(this).second);
|
||||
DModule = s.DModule;
|
||||
irModule = s.irModule;
|
||||
irStruct = s.irStruct;
|
||||
|
||||
@@ -13,13 +13,13 @@ void IrType::resetAll()
|
||||
|
||||
IrType::IrType()
|
||||
{
|
||||
list.insert(this);
|
||||
assert(list.insert(this).second);
|
||||
reset();
|
||||
}
|
||||
|
||||
IrType::IrType(const IrType& s)
|
||||
{
|
||||
list.insert(this);
|
||||
assert(list.insert(this).second);
|
||||
type = s.type;
|
||||
vtblType = s.type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user