[llvm] r244212 - Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 12:24:15 PDT 2015


Made some improvements to this in r244252

On Thu, Aug 6, 2015 at 6:18 AM, Yaron Keren via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: yrnkrn
> Date: Thu Aug  6 08:18:59 2015
> New Revision: 244212
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244212&view=rev
> Log:
> Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.
>
>
> Modified:
>     llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
>
> Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244212&r1=244211&r2=244212&view=diff
>
> ==============================================================================
> --- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Thu Aug  6 08:18:59 2015
> @@ -1099,6 +1099,14 @@ void AsmWriterEmitter::EmitPrintAliasIns
>    }
>
>    O << "#endif // PRINT_ALIAS_INSTR\n";
> +
> +  // Free allocated memory.
> +  for (auto &Aliases : AliasMap)
> +    for (auto &Alias : Aliases.second)
> +      delete Alias.first;
> +  for (auto &P : IAPrinterMap)
> +    for (IAPrinter* IAP : P.second)
> +      delete IAP;
>  }
>
>  AsmWriterEmitter::AsmWriterEmitter(RecordKeeper &R) : Records(R),
> Target(R) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150806/4e81bd0b/attachment.html>


More information about the llvm-commits mailing list