[llvm-commits] [llvm] r97990 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfDebug.h

Jeffrey Yasskin jyasskin at google.com
Wed Mar 10 16:01:38 PST 2010


On Tue, Mar 9, 2010 at 12:22 PM, Devang Patel <dpatel at apple.com> wrote:
>
> On Mar 9, 2010, at 10:54 AM, Jeffrey Yasskin wrote:
>
>> Now that nothing uses the result of constructCompileUnit() unless it
>> assigns the ModuleCU, can we just bail early when !DIUnit.isMain() and
>> avoid new'ing the DIE and CompileUnit?
>
> With the introduction of DIFile, we are moving away from "isMain" field.
>
>> Then, if we delete ModuleCU in
>> endModule(), this memory leak would go away.
>
> We should delete ModuleCU. That's an oversight. Please fix it or let me know, I'll do it.

I can take it. I assume it's correct to simply not create the
CompileUnits and DIEs whose addresses aren't obviously passed
anywhere? Or do I need to look out for constructors or other functions
that escape their addresses surreptitiously?



More information about the llvm-commits mailing list