comparison gen/functions.cpp @ 258:8dbddae09152 trunk

[svn r276] Fixed debug info for 'this' arg seemed to be broken.
author lindquist
date Thu, 12 Jun 2008 19:59:19 +0200
parents 8187884566fa
children 88252a1af660
comparison
equal deleted inserted replaced
257:4234b014a4f2 258:8dbddae09152
586 fd->vresult->ir.irLocal = new IrLocal(fd->vresult); 586 fd->vresult->ir.irLocal = new IrLocal(fd->vresult);
587 fd->vresult->ir.irLocal->value = new llvm::AllocaInst(DtoType(fd->vresult->type),"function_vresult",allocaPoint); 587 fd->vresult->ir.irLocal->value = new llvm::AllocaInst(DtoType(fd->vresult->type),"function_vresult",allocaPoint);
588 } 588 }
589 589
590 // give 'this' argument debug info (and storage) 590 // give 'this' argument debug info (and storage)
591 if (f->llvmUsesThis && global.params.symdebug) 591 if (fd->needThis() && global.params.symdebug)
592 { 592 {
593 LLValue** thisvar = &fd->ir.irFunc->thisVar; 593 LLValue** thisvar = &fd->ir.irFunc->thisVar;
594 assert(*thisvar); 594 assert(*thisvar);
595 LLValue* thismem = new llvm::AllocaInst((*thisvar)->getType(), "newthis", allocaPoint); 595 LLValue* thismem = new llvm::AllocaInst((*thisvar)->getType(), "newthis", allocaPoint);
596 DtoDwarfLocalVariable(thismem, fd->vthis); 596 DtoDwarfLocalVariable(thismem, fd->vthis);
606 { 606 {
607 Dsymbol* argsym = (Dsymbol*)fd->parameters->data[i]; 607 Dsymbol* argsym = (Dsymbol*)fd->parameters->data[i];
608 VarDeclaration* vd = argsym->isVarDeclaration(); 608 VarDeclaration* vd = argsym->isVarDeclaration();
609 assert(vd); 609 assert(vd);
610 610
611 // FIXME: llvm seems to want an alloca for debug info 611 // FIXME: llvm seems to want an alloca/byval for debug info
612 if (!vd->needsStorage || vd->nestedref || vd->isRef() || vd->isOut()) 612 if (!vd->needsStorage || vd->nestedref || vd->isRef() || vd->isOut())
613 continue; 613 continue;
614 // debug info for normal aggr params seem to work fine 614 // debug info for normal aggr params seem to work fine
615 else if (DtoIsPassedByRef(vd->type)) 615 else if (DtoIsPassedByRef(vd->type))
616 { 616 {