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);