Mercurial > projects > ldc
comparison gen/tocall.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 | cac9895be400 |
children | b2d27ddf8f45 |
comparison
equal
deleted
inserted
replaced
944:eb310635d80e | 945:03d7c4aac654 |
---|---|
134 // build struct with argument types (non variadic args) | 134 // build struct with argument types (non variadic args) |
135 for (int i=begin; i<n_arguments; i++) | 135 for (int i=begin; i<n_arguments; i++) |
136 { | 136 { |
137 Expression* argexp = (Expression*)arguments->data[i]; | 137 Expression* argexp = (Expression*)arguments->data[i]; |
138 vtypes.push_back(DtoType(argexp->type)); | 138 vtypes.push_back(DtoType(argexp->type)); |
139 size_t sz = getABITypeSize(vtypes.back()); | 139 size_t sz = getTypePaddedSize(vtypes.back()); |
140 if (sz < PTRSIZE) | 140 if (sz < PTRSIZE) |
141 vtypes.back() = DtoSize_t(); | 141 vtypes.back() = DtoSize_t(); |
142 } | 142 } |
143 const LLStructType* vtype = LLStructType::get(vtypes); | 143 const LLStructType* vtype = LLStructType::get(vtypes); |
144 | 144 |
461 CallOrInvoke* call = gIR->CreateCallOrInvoke(callable, args.begin(), args.end(), varname); | 461 CallOrInvoke* call = gIR->CreateCallOrInvoke(callable, args.begin(), args.end(), varname); |
462 | 462 |
463 // get return value | 463 // get return value |
464 LLValue* retllval = (retinptr) ? args[0] : call->get(); | 464 LLValue* retllval = (retinptr) ? args[0] : call->get(); |
465 | 465 |
466 // swap real/imag parts on a x87 | |
467 if (global.params.cpu == ARCHx86 && tf->nextOf()->toBasetype()->iscomplex()) | |
468 { | |
469 retllval = DtoAggrPairSwap(retllval); | |
470 } | |
471 | |
466 // repaint the type if necessary | 472 // repaint the type if necessary |
467 if (resulttype) | 473 if (resulttype) |
468 { | 474 { |
469 Type* rbase = resulttype->toBasetype(); | 475 Type* rbase = resulttype->toBasetype(); |
470 Type* nextbase = tf->nextOf()->toBasetype(); | 476 Type* nextbase = tf->nextOf()->toBasetype(); |