summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-11-28 05:01:21 +0000
committerCraig Topper <craig.topper@gmail.com>2014-11-28 05:01:21 +0000
commitce2748929332857065444e2a7a3cc19729e6eccb (patch)
treeae7ac0726dd3d68e656104d581b663fdbc4cc85b
parent44586dc4d692c16083ce49268ac35c9dcc84484f (diff)
downloadbcm5719-llvm-ce2748929332857065444e2a7a3cc19729e6eccb.tar.gz
bcm5719-llvm-ce2748929332857065444e2a7a3cc19729e6eccb.zip
Fix another memory leak in TableGen AsmMatcher by deleting CodeGenInstAliases.
llvm-svn: 222912
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 45fc26801d3..366fbc3744b 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<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);
OpenPOWER on IntegriCloud