[llvm-commits] [llvm] r124734 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Kevin Enderby enderby at apple.com
Wed Feb 2 10:20:55 PST 2011


Author: enderby
Date: Wed Feb  2 12:20:55 2011
New Revision: 124734

URL: http://llvm.org/viewvc/llvm-project?rev=124734&view=rev
Log:
Changed the TableGen created MatchInstructionImpl() setting of ErrorInfo.

The algorithm for identifying which operand is invalid will now always point to
some operand and not the mnemonic sometimes.  The change is now that ErrorInfo
is the index of the highest operand that does not match for any of the matching
mnemonics records.  And no longer the ~0U value when the mnemonic matches and
not every record with a matching mnemonic has the same mismatching operand
index.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=124734&r1=124733&r2=124734&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Feb  2 12:20:55 2011
@@ -2098,10 +2098,8 @@
   OS << "        continue;\n";
   OS << "      // If this operand is broken for all of the instances of this\n";
   OS << "      // mnemonic, keep track of it so we can report loc info.\n";
-  OS << "      if (it == MnemonicRange.first || ErrorInfo == i+1)\n";
+  OS << "      if (it == MnemonicRange.first || ErrorInfo <= i+1)\n";
   OS << "        ErrorInfo = i+1;\n";
-  OS << "      else\n";
-  OS << "        ErrorInfo = ~0U;";
   OS << "      // Otherwise, just reject this instance of the mnemonic.\n";
   OS << "      OperandsValid = false;\n";
   OS << "      break;\n";





More information about the llvm-commits mailing list