mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-09 04:15:58 +03:00
Implement -nested-ctx=hybrid
This commit is contained in:
parent
8820024070
commit
751f528969
5 changed files with 194 additions and 25 deletions
|
@ -673,13 +673,6 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||
// debug info - after all allocas, but before any llvm.dbg.declare etc
|
||||
if (global.params.symdebug) DtoDwarfFuncStart(fd);
|
||||
|
||||
// need result variable?
|
||||
if (fd->vresult) {
|
||||
Logger::println("vresult value");
|
||||
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.
|
||||
if (fd->inlineAsm)
|
||||
|
@ -778,6 +771,18 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||
|
||||
DtoCreateNestedContext(fd);
|
||||
|
||||
#if DMDV2
|
||||
if (fd->vresult && fd->vresult->nestedrefs.dim)
|
||||
#else
|
||||
if (fd->vresult && fd->vresult->nestedref)
|
||||
#endif
|
||||
{
|
||||
DtoNestedInit(fd->vresult);
|
||||
} else if (fd->vresult) {
|
||||
fd->vresult->ir.irLocal = new IrLocal(fd->vresult);
|
||||
fd->vresult->ir.irLocal->value = DtoAlloca(DtoType(fd->vresult->type), fd->vresult->toChars());
|
||||
}
|
||||
|
||||
// copy _argptr and _arguments to a memory location
|
||||
if (f->linkage == LINKd && f->varargs == 1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue