Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.
authorCraig Topper <craig.topper@gmail.com>
Fri, 28 Nov 2014 05:01:21 +0000 (05:01 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 28 Nov 2014 05:01:21 +0000 (05:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222912 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/AsmMatcherEmitter.cpp

index 45fc26801d3487312ea68b83a289d1f004f0cb30..366fbc3744b73d9f51e3e25117eab8b7499d13d8 100644 (file)
@@ -442,6 +442,11 @@ struct MatchableInfo {
       AsmString(Alias->AsmString) {
   }
 
+  ~MatchableInfo() {
+    if (DefRec.is<const CodeGenInstAlias*>())
+      delete DefRec.get<const CodeGenInstAlias*>();
+  }
+
   // 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);