Mercurial > projects > ldc
comparison gen/classes.cpp @ 945:03d7c4aac654
SWITCHED TO LLVM 2.5 !
Applied patch from ticket #129 to compile against latest LLVM. Thanks Frits van Bommel.
Fixed implicit return by asm block at the end of a function on x86-32. Other architectures will produce an error at the moment. Adding support for new targets is fairly simple.
Fixed return calling convention for complex numbers, ST and ST(1) were switched around.
Added some testcases.
I've run a dstress test and there are no regressions. However, the runtime does not seem to compile with symbolic debug information. -O3 -release -inline works well and is what I used for the dstress run. Tango does not compile, a small workaround is needed in tango.io.digest.Digest.Digest.hexDigest. See ticket #206 .
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sun, 08 Feb 2009 05:26:54 +0100 |
parents | 39519a1ff603 |
children | 8c73ff5f69e0 |
comparison
equal
deleted
inserted
replaced
944:eb310635d80e | 945:03d7c4aac654 |
---|---|
971 | 971 |
972 void DtoInitClass(TypeClass* tc, LLValue* dst) | 972 void DtoInitClass(TypeClass* tc, LLValue* dst) |
973 { | 973 { |
974 DtoForceConstInitDsymbol(tc->sym); | 974 DtoForceConstInitDsymbol(tc->sym); |
975 | 975 |
976 size_t presz = 2*getABITypeSize(DtoSize_t()); | 976 size_t presz = 2*getTypePaddedSize(DtoSize_t()); |
977 uint64_t n = getABITypeSize(tc->ir.type->get()) - presz; | 977 uint64_t n = getTypePaddedSize(tc->ir.type->get()) - presz; |
978 | 978 |
979 // set vtable field seperately, this might give better optimization | 979 // set vtable field seperately, this might give better optimization |
980 assert(tc->sym->ir.irStruct->vtbl); | 980 assert(tc->sym->ir.irStruct->vtbl); |
981 LLValue* tmp = DtoGEPi(dst,0,0,"vtbl"); | 981 LLValue* tmp = DtoGEPi(dst,0,0,"vtbl"); |
982 LLValue* val = DtoBitCast(tc->sym->ir.irStruct->vtbl, tmp->getType()->getContainedType(0)); | 982 LLValue* val = DtoBitCast(tc->sym->ir.irStruct->vtbl, tmp->getType()->getContainedType(0)); |
1492 c = DtoConstSlice(DtoConstSize_t(0), LLConstant::getNullValue(voidPtr)); | 1492 c = DtoConstSlice(DtoConstSize_t(0), LLConstant::getNullValue(voidPtr)); |
1493 else | 1493 else |
1494 { | 1494 { |
1495 c = DtoBitCast(ir->init, voidPtr); | 1495 c = DtoBitCast(ir->init, voidPtr); |
1496 //Logger::cout() << *ir->constInit->getType() << std::endl; | 1496 //Logger::cout() << *ir->constInit->getType() << std::endl; |
1497 size_t initsz = getABITypeSize(ir->init->getType()->getContainedType(0)); | 1497 size_t initsz = getTypePaddedSize(ir->init->getType()->getContainedType(0)); |
1498 c = DtoConstSlice(DtoConstSize_t(initsz), c); | 1498 c = DtoConstSlice(DtoConstSize_t(initsz), c); |
1499 } | 1499 } |
1500 inits.push_back(c); | 1500 inits.push_back(c); |
1501 | 1501 |
1502 // class name | 1502 // class name |