Mercurial > projects > ldc
diff gen/tollvm.c @ 83:339422268de1 trunk
[svn r87] Fixed some memory bloat when passing string literals as char[] params (double temporary before)
author | lindquist |
---|---|
date | Fri, 02 Nov 2007 02:03:13 +0100 |
parents | d8dd47ef3973 |
children | f869c636a113 |
line wrap: on
line diff
--- a/gen/tollvm.c Fri Nov 02 01:17:26 2007 +0100 +++ b/gen/tollvm.c Fri Nov 02 02:03:13 2007 +0100 @@ -1196,6 +1196,9 @@ allocaInst = new llvm::AllocaInst(realtypell, "tmpparam", gIR->topallocapoint()); DtoSetArray(allocaInst, arg->arg, arg->mem); } + else if (arg->temp) { + allocaInst = arg->mem; + } else { allocaInst = new llvm::AllocaInst(pty->getElementType(), "tmpparam", gIR->topallocapoint()); DtoArrayAssign(allocaInst,arg->mem); @@ -1204,7 +1207,6 @@ else assert(0); - assert(allocaInst != 0); retval = allocaInst; } }