comparison gen/functions.cpp @ 1510:b6b6afc2dfc7

Put scope-limited data on the stack instead of using 'new' and 'delete'.
author Frits van Bommel <fvbommel wxs.nl>
date Sat, 20 Jun 2009 19:44:54 +0200
parents e1e93343fc11
children 8ca25bd765a3
comparison
equal deleted inserted replaced
1509:e07f15c4ab4d 1510:b6b6afc2dfc7
772 new llvm::StoreInst(fd->ir.irFunc->_arguments, argumentsmem, gIR->scopebb()); 772 new llvm::StoreInst(fd->ir.irFunc->_arguments, argumentsmem, gIR->scopebb());
773 fd->ir.irFunc->_arguments = argumentsmem; 773 fd->ir.irFunc->_arguments = argumentsmem;
774 } 774 }
775 775
776 // output function body 776 // output function body
777 irfunction->gen = new FuncGen; 777 {
778 fd->fbody->toIR(gIR); 778 FuncGen fg;
779 delete irfunction->gen; 779 irfunction->gen = &fg;
780 irfunction->gen = 0; 780 fd->fbody->toIR(gIR);
781 irfunction->gen = 0;
782 }
781 783
782 // TODO: clean up this mess 784 // TODO: clean up this mess
783 785
784 // std::cout << *func << std::endl; 786 // std::cout << *func << std::endl;
785 787