[PATCH] D11337: Fix bug in ins and outs operand order

Reid Kleckner rnk at google.com
Mon Jul 20 12:53:54 PDT 2015


rnk added inline comments.

================
Comment at: lib/Target/X86/AsmParser/X86AsmParser.cpp:2231-2236
@@ -2230,7 +2230,7 @@
        Name == "insd" )) {
     if (isParsingIntelSyntax()) {
+      Operands.push_back(DefaultMemDIOperand(NameLoc));
       Operands.push_back(X86Operand::CreateReg(X86::DX, NameLoc, NameLoc));
-      Operands.push_back(DefaultMemDIOperand(NameLoc));
     } else {
       Operands.push_back(X86Operand::CreateReg(X86::DX, NameLoc, NameLoc));
       Operands.push_back(DefaultMemDIOperand(NameLoc));
----------------
We should fix this by writing a helper method with a signature like the following:
  addDefaultSrcDestOperands(Operands, Src, Dst);
It eliminates an error-prone construct and reduces duplication.


Repository:
  rL LLVM

http://reviews.llvm.org/D11337







More information about the llvm-commits mailing list