comparison gen/toir.c @ 25:12fd8ce55d9c trunk

[svn r29] * Fixed structs inside struct literals
author lindquist
date Thu, 04 Oct 2007 10:22:56 +0200
parents 25bb577878e8
children 99737f94abfb
comparison
equal deleted inserted replaced
24:25bb577878e8 25:12fd8ce55d9c
1376 Expression* vx = (Expression*)elements->data[i]; 1376 Expression* vx = (Expression*)elements->data[i];
1377 if (vx != 0) { 1377 if (vx != 0) {
1378 elem* ve = vx->toElem(p); 1378 elem* ve = vx->toElem(p);
1379 llvm::Value* val = ve->getValue(); 1379 llvm::Value* val = ve->getValue();
1380 Logger::cout() << *val << " | " << *arrptr << '\n'; 1380 Logger::cout() << *val << " | " << *arrptr << '\n';
1381 new llvm::StoreInst(val, arrptr, p->scopebb()); 1381 if (vx->type->ty == Tstruct) {
1382 TypeStruct* ts = (TypeStruct*)vx->type;
1383 LLVM_DtoStructCopy(ts,arrptr,val);
1384 }
1385 else
1386 new llvm::StoreInst(val, arrptr, p->scopebb());
1382 delete ve; 1387 delete ve;
1383 } 1388 }
1384 else { 1389 else {
1385 assert(0); 1390 assert(0);
1386 } 1391 }