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

Daniel Dunbar daniel at zuster.org
Sun Aug 9 01:23:23 PDT 2009


Author: ddunbar
Date: Sun Aug  9 03:23:23 2009
New Revision: 78533

URL: http://llvm.org/viewvc/llvm-project?rev=78533&view=rev
Log:
llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.

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=78533&r1=78532&r2=78533&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Aug  9 03:23:23 2009
@@ -396,10 +396,15 @@
     if (Operands.size() != RHS.Operands.size())
       return Operands.size() < RHS.Operands.size();
 
-    for (unsigned i = 0, e = Operands.size(); i != e; ++i)
+    // Compare lexicographically by operand. The matcher validates that other
+    // orderings wouldn't be ambiguous using \see CouldMatchAmiguouslyWith().
+    for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
       if (*Operands[i].Class < *RHS.Operands[i].Class)
         return true;
-    
+      if (*RHS.Operands[i].Class < *Operands[i].Class)
+        return false;
+    }
+
     return false;
   }
 





More information about the llvm-commits mailing list