First step towards D abi compliance.

Framepointer elimination is now disabled for functions using inline asm (with a hack from aKor).
This commit is contained in:
Tomas Lindquist Olsen 2008-08-19 20:18:01 +02:00
parent 9caf74c59b
commit 3346a78e71
3 changed files with 47 additions and 1 deletions

View file

@ -592,6 +592,16 @@ void DtoDefineFunc(FuncDeclaration* fd)
fd->vresult->ir.irLocal = new IrLocal(fd->vresult);
fd->vresult->ir.irLocal->value = DtoAlloca(DtoType(fd->vresult->type), "function_vresult");
}
// this hack makes sure the frame pointer elimination optimization is disabled.
// this this eliminates a bunch of inline asm related issues.
// naked must always eliminate the framepointer however...
if (fd->inlineAsm && !fd->naked)
{
// emit a call to llvm_eh_unwind_init
LLFunction* hack = GET_INTRINSIC_DECL(eh_unwind_init);
gIR->ir->CreateCall(hack, "");
}
// give the 'this' argument storage and debug info
if (f->usesThis)