diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 45fc26801d34..366fbc3744b7 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()) + 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);