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)
llvm-svn: 222912

llvm/utils/TableGen/AsmMatcherEmitter.cpp

index 45fc268..366fbc3 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);