[MC] Reset the MCInst in the matcher function before adding opcode/operands.
[oota-llvm.git] / utils / TableGen / AsmMatcherEmitter.cpp
index 5b2ff6792d4e1f8a4a8cb80c9cb017f912e5857a..85312b13923b3d792bc3643c5e02aa72205325fc 100644 (file)
@@ -2965,6 +2965,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
   OS << "      continue;\n";
   OS << "    }\n";
   OS << "\n";
+  OS << "    Inst.clear();\n\n";
   OS << "    if (matchingInlineAsm) {\n";
   OS << "      Inst.setOpcode(it->Opcode);\n";
   OS << "      convertToMapAndConstraints(it->ConvertFn, Operands);\n";