mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-31 03:53:14 +01:00
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 .
This commit is contained in:
@@ -81,6 +81,12 @@ void ReturnStatement::toIR(IRState* p)
|
||||
LLValue* v = e->getRVal();
|
||||
delete e;
|
||||
|
||||
// swap real/imag parts on a x87
|
||||
if (global.params.cpu == ARCHx86 && exp->type->toBasetype()->iscomplex())
|
||||
{
|
||||
v = DtoAggrPairSwap(v);
|
||||
}
|
||||
|
||||
if (Logger::enabled())
|
||||
Logger::cout() << "return value is '" <<*v << "'\n";
|
||||
|
||||
@@ -1198,6 +1204,9 @@ void LabelStatement::toIR(IRState* p)
|
||||
a->code += ":";
|
||||
p->asmBlock->s.push_back(a);
|
||||
p->asmBlock->internalLabels.push_back(ident);
|
||||
|
||||
// disable inlining
|
||||
gIR->func()->setNeverInline();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1453,3 +1462,31 @@ STUBST(Statement);
|
||||
#if DMDV2
|
||||
STUBST(PragmaStatement);
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AsmBlockStatement* Statement::endsWithAsm()
|
||||
{
|
||||
// does not end with inline asm
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AsmBlockStatement* CompoundStatement::endsWithAsm()
|
||||
{
|
||||
// make the last inner statement decide
|
||||
if (statements && statements->dim)
|
||||
{
|
||||
unsigned last = statements->dim - 1;
|
||||
Statement* s = (Statement*)statements->data[last];
|
||||
if (s) return s->endsWithAsm();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AsmBlockStatement* AsmBlockStatement::endsWithAsm()
|
||||
{
|
||||
// yes this is inline asm
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user