comparison gen/functions.cpp @ 526:642f6fa854e5

First step towards D abi compliance. Framepointer elimination is now disabled for functions using inline asm (with a hack from aKor).
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 19 Aug 2008 20:18:01 +0200
parents c9a606d6e641
children cecfee2d01a8
comparison
equal deleted inserted replaced
525:b18b6135e54b 526:642f6fa854e5
590 if (fd->vresult) { 590 if (fd->vresult) {
591 Logger::println("vresult value"); 591 Logger::println("vresult value");
592 fd->vresult->ir.irLocal = new IrLocal(fd->vresult); 592 fd->vresult->ir.irLocal = new IrLocal(fd->vresult);
593 fd->vresult->ir.irLocal->value = DtoAlloca(DtoType(fd->vresult->type), "function_vresult"); 593 fd->vresult->ir.irLocal->value = DtoAlloca(DtoType(fd->vresult->type), "function_vresult");
594 } 594 }
595
596 // this hack makes sure the frame pointer elimination optimization is disabled.
597 // this this eliminates a bunch of inline asm related issues.
598 // naked must always eliminate the framepointer however...
599 if (fd->inlineAsm && !fd->naked)
600 {
601 // emit a call to llvm_eh_unwind_init
602 LLFunction* hack = GET_INTRINSIC_DECL(eh_unwind_init);
603 gIR->ir->CreateCall(hack, "");
604 }
595 605
596 // give the 'this' argument storage and debug info 606 // give the 'this' argument storage and debug info
597 if (f->usesThis) 607 if (f->usesThis)
598 { 608 {
599 LLValue* thisvar = irfunction->thisArg; 609 LLValue* thisvar = irfunction->thisArg;