From: Craig Topper Date: Fri, 28 Nov 2014 05:01:21 +0000 (+0000) Subject: Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce2748929332857065444e2a7a3cc19729e6eccb;p=platform%2Fupstream%2Fllvm.git Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases. llvm-svn: 222912 --- diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 45fc268..366fbc37 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -442,6 +442,11 @@ struct MatchableInfo { AsmString(Alias->AsmString) { } + ~MatchableInfo() { + if (DefRec.is()) + delete DefRec.get(); + } + // Two-operand aliases clone from the main matchable, but mark the second // operand as a tied operand of the first for purposes of the assembler. void formTwoOperandAlias(StringRef Constraint);