From 9fd6eebf92fc7fb5887a8f822f765e2e2d7d268f Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 28 Nov 2014 05:01:21 +0000 Subject: [PATCH] Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222912 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/AsmMatcherEmitter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 45fc26801d3..366fbc3744b 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/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);