[llvm] r222912 - Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.

Craig Topper craig.topper at gmail.com
Thu Nov 27 21:01:21 PST 2014


Author: ctopper
Date: Thu Nov 27 23:01:21 2014
New Revision: 222912

URL: http://llvm.org/viewvc/llvm-project?rev=222912&view=rev
Log:
Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=222912&r1=222911&r2=222912&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Thu Nov 27 23:01:21 2014
@@ -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);





More information about the llvm-commits mailing list