diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 08:23:23 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 08:23:23 +0000 |
commit | db2ddb5dc57319eff249144f1d9a553a3278d2e0 (patch) | |
tree | 827b5aa55f7307e15ae26505bc7179fee794d6a8 /utils | |
parent | 72fa87f0cfe22faa575280dbac8dbc9225dfb12d (diff) |
llvm-mc/AsmParser: Fix thinko in ClassInfo::operator<.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index a13bc4e0b9..ef9ab20553 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -396,10 +396,15 @@ struct InstructionInfo { 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; } |